# HG changeset patch # User jwe # Date 923510060 0 # Node ID 2e74d8aa1a2018594d447dbe0050beaba312b655 # Parent d54ef0aa6e824af4daf81b87b4cf295df9b319c7 [project @ 1999-04-07 18:33:23 by jwe] diff -r d54ef0aa6e82 -r 2e74d8aa1a20 readline/configure --- a/readline/configure Sat Mar 27 17:40:46 1999 +0000 +++ b/readline/configure Wed Apr 07 18:34:20 1999 +0000 @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in for Readline 2.1, version 2.04, from autoconf version 2.12 +# From configure.in for Readline 2.1, version 2.04, from autoconf version 2.13 LIBVERSION=2.1 @@ -77,7 +77,7 @@ # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.12 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -125,6 +125,7 @@ # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 @@ -408,7 +409,7 @@ verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.12" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -578,9 +579,11 @@ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross +ac_exeext= +ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then @@ -620,26 +623,26 @@ # Make sure we can run config.sub. -if $ac_config_sub sun4 >/dev/null 2>&1; then : +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:629: checking host system type" >&5 +echo "configure:632: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) - if host_alias=`$ac_config_guess`; then : + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac -host=`$ac_config_sub $host_alias` +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` @@ -652,15 +655,16 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:656: checking for $ac_word" >&5 +echo "configure:659: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" @@ -681,16 +685,17 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:685: checking for $ac_word" >&5 +echo "configure:689: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - for ac_dir in $PATH; do + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then @@ -725,25 +730,61 @@ echo "$ac_t""no" 1>&6 fi + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:740: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross -cat > conftest.$ac_ext < conftest.$ac_ext << EOF + +#line 783 "configure" #include "confdefs.h" + main(){return(0);} EOF -if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -757,18 +798,24 @@ ac_cv_prog_cc_works=no fi rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:772: checking whether we are using GNU C" >&5 +echo "configure:819: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -777,7 +824,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -788,11 +835,15 @@ if test $ac_cv_prog_gcc = yes; then GCC=yes - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:796: checking whether ${CC-cc} accepts -g" >&5 +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:847: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -807,16 +858,20 @@ fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then CFLAGS="-g -O2" else - CFLAGS="-O2" + CFLAGS="-g" fi else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi @@ -824,7 +879,7 @@ test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:828: checking how to run the C preprocessor" >&5 +echo "configure:883: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -839,14 +894,14 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` +{ (eval echo configure:904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else @@ -856,14 +911,31 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` +{ (eval echo configure:921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else @@ -876,6 +948,8 @@ rm -f conftest* fi rm -f conftest* +fi +rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" @@ -886,13 +960,13 @@ if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:890: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:964: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -910,7 +984,7 @@ if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -938,28 +1012,30 @@ # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# 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" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:946: checking for a BSD compatible install" >&5 +echo "configure:1021: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in ginstall installbsd scoinst install; do + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" @@ -989,20 +1065,23 @@ # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:998: checking for $ac_word" >&5 +echo "configure:1076: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" @@ -1022,12 +1101,12 @@ echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1026: checking return type of signal handlers" >&5 +echo "configure:1105: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1044,7 +1123,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:1048: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1064,12 +1143,12 @@ echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:1068: checking whether stat file-mode macros are broken" >&5 +echo "configure:1147: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1124,12 +1203,12 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1128: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1207: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1137,7 +1216,7 @@ DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1162,7 +1241,7 @@ # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1166: checking for opendir in -ldir" >&5 +echo "configure:1245: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1170,7 +1249,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1203,7 +1282,7 @@ else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1207: checking for opendir in -lx" >&5 +echo "configure:1286: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1211,7 +1290,7 @@ ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1248,12 +1327,12 @@ for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1252: checking for $ac_func" >&5 +echo "configure:1331: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1302,7 +1381,7 @@ echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:1306: checking for working strcoll" >&5 +echo "configure:1385: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1310,7 +1389,7 @@ ac_cv_func_strcoll_works=no else cat > conftest.$ac_ext < main () @@ -1320,7 +1399,7 @@ strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:1324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes else @@ -1349,18 +1428,18 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1353: checking for $ac_hdr" >&5 +echo "configure:1432: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out` +{ (eval echo configure:1442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" @@ -1388,13 +1467,13 @@ echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 -echo "configure:1392: checking for type of signal functions" >&5 +echo "configure:1471: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -1407,7 +1486,7 @@ ; return 0; } EOF -if { (eval echo configure:1411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=posix else @@ -1416,7 +1495,7 @@ rm -rf conftest* cat > conftest.$ac_ext < int main() { @@ -1426,7 +1505,7 @@ ; return 0; } EOF -if { (eval echo configure:1430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=4.2bsd else @@ -1435,7 +1514,7 @@ rm -rf conftest* cat > conftest.$ac_ext < @@ -1448,7 +1527,7 @@ ; return 0; } EOF -if { (eval echo configure:1452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=svr3 else @@ -1489,7 +1568,7 @@ echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6 -echo "configure:1493: checking if signal handlers must be reinstalled when invoked" >&5 +echo "configure:1572: checking if signal handlers must be reinstalled when invoked" >&5 if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1501,7 +1580,7 @@ fi else cat > conftest.$ac_ext < @@ -1548,7 +1627,7 @@ } EOF -if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then bash_cv_must_reinstall_sighandlers=no else @@ -1577,7 +1656,7 @@ echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6 -echo "configure:1581: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 +echo "configure:1660: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5 if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1585,7 +1664,7 @@ bash_cv_func_sigsetjmp=present else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then bash_cv_func_sigsetjmp=present else @@ -1654,12 +1733,12 @@ fi echo $ac_n "checking for lstat""... $ac_c" 1>&6 -echo "configure:1658: checking for lstat" >&5 +echo "configure:1737: checking for lstat" >&5 if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1669,7 +1748,7 @@ lstat("",(struct stat *)0); ; return 0; } EOF -if { (eval echo configure:1673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_func_lstat=yes else @@ -1690,12 +1769,12 @@ fi echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6 -echo "configure:1694: checking whether programs are able to redeclare getpw functions" >&5 +echo "configure:1773: checking whether programs are able to redeclare getpw functions" >&5 if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1704,7 +1783,7 @@ struct passwd *z; z = getpwent(); ; return 0; } EOF -if { (eval echo configure:1708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_can_redecl_getpw=yes else @@ -1726,7 +1805,7 @@ echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6 -echo "configure:1730: checking whether or not strcoll and strcmp differ" >&5 +echo "configure:1809: checking whether or not strcoll and strcmp differ" >&5 if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1734,7 +1813,7 @@ bash_cv_func_strcoll_broken=no else cat > conftest.$ac_ext < @@ -1773,7 +1852,7 @@ } EOF -if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then bash_cv_func_strcoll_broken=yes else @@ -1802,12 +1881,12 @@ echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6 -echo "configure:1806: checking whether signal handlers are of type void" >&5 +echo "configure:1885: checking whether signal handlers are of type void" >&5 if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1822,7 +1901,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:1826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_void_sighandler=yes else @@ -1842,12 +1921,12 @@ fi echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6 -echo "configure:1846: checking for TIOCGWINSZ in sys/ioctl.h" >&5 +echo "configure:1925: checking for TIOCGWINSZ in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1855,7 +1934,7 @@ int x = TIOCGWINSZ; ; return 0; } EOF -if { (eval echo configure:1859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocgwinsz_in_ioctl=yes else @@ -1876,12 +1955,12 @@ fi echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6 -echo "configure:1880: checking for TIOCSTAT in sys/ioctl.h" >&5 +echo "configure:1959: checking for TIOCSTAT in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1889,7 +1968,7 @@ int x = TIOCSTAT; ; return 0; } EOF -if { (eval echo configure:1893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_tiocstat_in_ioctl=yes else @@ -1910,12 +1989,12 @@ fi echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6 -echo "configure:1914: checking for FIONREAD in sys/ioctl.h" >&5 +echo "configure:1993: checking for FIONREAD in sys/ioctl.h" >&5 if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1923,7 +2002,7 @@ int x = FIONREAD; ; return 0; } EOF -if { (eval echo configure:1927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_fionread_in_ioctl=yes else @@ -1944,19 +2023,19 @@ fi echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:1948: checking for speed_t in sys/types.h" >&5 +echo "configure:2027: checking for speed_t in sys/types.h" >&5 if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { speed_t x; ; return 0; } EOF -if { (eval echo configure:1960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_speed_t_in_sys_types=yes else @@ -1978,12 +2057,12 @@ echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6 -echo "configure:1982: checking if struct dirent has a d_ino member" >&5 +echo "configure:2061: checking if struct dirent has a d_ino member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2012,7 +2091,7 @@ ; return 0; } EOF -if { (eval echo configure:2016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_dino=yes else @@ -2034,12 +2113,12 @@ echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6 -echo "configure:2038: checking if struct dirent has a d_fileno member" >&5 +echo "configure:2117: checking if struct dirent has a d_fileno member" >&5 if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2068,7 +2147,7 @@ ; return 0; } EOF -if { (eval echo configure:2072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bash_cv_dirent_has_d_fileno=yes else @@ -2129,7 +2208,7 @@ # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - case `(ac_space=' '; set) 2>&1` in + case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). @@ -2196,7 +2275,7 @@ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.12" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -2216,9 +2295,11 @@ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub +s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g @@ -2245,6 +2326,7 @@ s%@CC@%$CC%g s%@CPP@%$CPP%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@RANLIB@%$RANLIB%g s%@LOCAL_CFLAGS@%$LOCAL_CFLAGS%g diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/ChangeLog --- a/scripts/ChangeLog Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/ChangeLog Wed Apr 07 18:34:20 1999 +0000 @@ -1,3 +1,21 @@ +Wed Apr 7 13:22:43 1999 A. S. Hodel + + * control/is_controllable.m, control/zgscal.m: Accomodate new + version of krylov and krylovb. + + * control/outlist.m, control/sysout.m: Fix typos. + + * control/sysdimensions.m: Add option for total number of states. + + * linear-algebra/krylov.m: Improve robustness by row-pivoting. + * linear-algebra/krylovb.m: Just call krylov with appropriate + arguments. + +Tue Mar 30 00:43:09 1999 John W. Eaton + + * strings/index.m: Fail with meaningful error message if either + arg is a string array. + Wed Mar 24 20:34:48 1999 John W. Eaton * linear-algebra/norm.m: Do the right thing for 1- and diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/control/is_controllable.m --- a/scripts/control/is_controllable.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/control/is_controllable.m Wed Apr 07 18:34:20 1999 +0000 @@ -83,14 +83,7 @@ else # call block-krylov subspace routine to get an orthogonal basis # of the controllable subspace. - if(nc == 1) - [U,H,Ucols] = krylov(a,b,n,tol,1); - U = U(:,1:Ucols); - else - [U,Ucols] = krylovb(a,b,n,tol); - U = U(:,1:Ucols); - endif - + [U,H,Ucols] = krylov(a,b,n,tol,1); retval = (Ucols == n); endif endfunction diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/control/outlist.m --- a/scripts/control/outlist.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/control/outlist.m Wed Apr 07 18:34:20 1999 +0000 @@ -57,7 +57,7 @@ dstr = list(""," (discrete)"); if((m >= 1) && (is_list(name_list))) for ii=1:m - str_val = sprintf("%s%s%d: %s%s\n",str_val,tabchar, ii, ... + str_val = sprintf("%s%s%d: %s%s\n",str_val,tabchar, ilist(ii), ... nth(name_list,ii),nth(dstr,yd(ii)+1)); endfor else diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/control/sysdimensions.m --- a/scripts/control/sysdimensions.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/control/sysdimensions.m Wed Apr 07 18:34:20 1999 +0000 @@ -24,8 +24,9 @@ # "all" (default): return all output arguments (see below) # "cst": return n=number of continuous states # "dst": return n=number of discrete states +# "st": return n=number of states (continuous and discrete) # "in": return n=number of inputs -# "out": return n = number of outputs +# "out": return n=number of outputs # outputs: # n: number of continuous states (or the specified dimension as shown above) # nz: number of discrete states @@ -49,16 +50,21 @@ m = length(sysgetsignals(sys,"in")); p = length(sysgetsignals(sys,"out")); yd = sys.yd; -legal_options = list("all","cst","dst","in","out"); -legal_values = list(n,n,nz,m,p); +legal_options = list("all","cst","dst","st","in","out"); +legal_values = list(n,n,nz,n+nz,m,p); +legal_opt = 0; for ii=1:length(legal_options) if(strcmp(nth(legal_options,ii),opt)) n = nth(legal_values,ii); + legal_opt = 1; if(ii > 1 & nargout > 1) warning("opt=%s, %d output arguments requested",opt,nargout); endif endif endfor +if(!legal_opt) + error("illegal option passed = %s",opt); +endif endfunction diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/control/sysidx.m --- a/scripts/control/sysidx.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/control/sysidx.m Wed Apr 07 18:34:20 1999 +0000 @@ -31,7 +31,10 @@ for idx = 1:length(signamelist) signame = nth(signamelist,idx); idxvec(idx) = 0; - for jdx = 1:sysdimensions(sys,sigtype) + nsigs = sysdimensions(sys,sigtype); + for jdx = 1:nsigs + #printf("idx=%d jdx=%d signame=-%s- thissig=-%s-\n",idx,jdx,signame, ... + # sysgetsignals(sys,sigtype,jdx,1)); if(strcmp(signame,sysgetsignals(sys,sigtype,jdx,1))) if(idxvec(idx) != 0) warning("Duplicate system input %s (%d,%d)\n", ... diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/control/sysout.m --- a/scripts/control/sysout.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/control/sysout.m Wed Apr 07 18:34:20 1999 +0000 @@ -113,17 +113,17 @@ # display matrix values? dmat = (max( [ (nn+nz), mm, pp ] ) <= 32); - printf("A matrix: %d x %d\n",nn,nn); + printf("A matrix: %d x %d\n",sysdimensions(sys,"st"),sysdimensions(sys,"st")); [aa,bb,cc,dd] = sys2ss(sys); if(dmat) disp(aa); endif - printf("B matrix: %d x %d\n",nn,mm); + printf("B matrix: %d x %d\n",sysdimensions(sys,"st"),sysdimensions(sys,"in")); if(dmat) disp(bb); endif - printf("C matrix: %d x %d\n",pp,nn); + printf("C matrix: %d x %d\n",sysdimensions(sys,"out"),sysdimensions(sys,"st")); if(dmat) disp(cc); endif - printf("D matrix: %d x %d\n",pp,nn); + printf("D matrix: %d x %d\n",sysdimensions(sys,"out"),sysdimensions(sys,"in")); if(dmat) disp(dd); endif endif diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/control/zgscal.m --- a/scripts/control/zgscal.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/control/zgscal.m Wed Apr 07 18:34:20 1999 +0000 @@ -49,7 +49,7 @@ F(1:nmp,kk) = zgfmul(a,b,c,d,F(:,kk)); endfor - [U,H,k1] = krylov(F,z,nmp,1e-12); + [U,H,k1] = krylov(F,z,nmp,1e-12,1); if(!is_square(H)) if(columns(H) != k1) error("zgscal(tzero): k1=%d, columns(H)=%d",k1,columns(H)); diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/linear-algebra/krylov.m --- a/scripts/linear-algebra/krylov.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/linear-algebra/krylov.m Wed Apr 07 18:34:20 1999 +0000 @@ -1,162 +1,188 @@ -# Copyright (C) 1996,1998 A. Scottedward Hodel +# Copyright (C) 1993, 1998, 1999 A. Scottedward Hodel +# +# This file is part of Octave. # -# This file is part of Octave. +# Octave 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. +# +# Octave 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. # -# Octave 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. -# -# Octave 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 Octave; see the file COPYING. If not, write to the Free -# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with Octave; see the file COPYING. If not, write to the Free +# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +function [Uret,H,nu] = krylov(A,V,k,eps1,pflg); + # function [U,H,nu] = krylov(A,V,k{,eps1,pflg}); + # construct orthogonal basis U of block Krylov subspace; + # [V AV A^2*V ... A^(k+1)*V]; + # method used: householder reflections to guard against loss of + # orthogonality + # eps1: threshhold for 0 (default: 1e-12) + # pflg: flag to use row pivoting (improves numerical behavior) + # 0 [default]: no pivoting; prints a warning message if trivial + # null space is corrupted + # 1 : pivoting performed + # + # outputs: + # Uret: orthogonal basis of block krylov subspace + # H: Hessenberg matrix; if V is a vector then A U = U H + # otherwise H is meaningless + # nu: dimension of span of krylov subspace (based on eps1) + # if B is a vector and k > m-1, krylov returns H = the Hessenberg + # decompostion of A. + # + # Reference: Hodel and Misra, "Partial Pivoting in the Computation of + # Krylov Subspaces", In preparation. + + defeps = 1e-12; + if(nargin < 3 | nargin > 5) + usage("[U,nu] = krylov(A,V,k{,eps1,pflg})") + elseif(nargin < 5) + pflg = 0; # default permutation flag + endif + if(nargin < 4) + eps1 = defeps; # default tolerance parameter + endif + if(isempty(eps1)) eps1 = defeps; endif + + na = is_square(A); + if( !na ) error("A(%d x %d) must be square",rows(A),columns(A)); endif -function [U,H,k1] = krylov(A,v,k,eps1,pflg); - # function [U,H,k1] = krylov(A,v,k{,eps1}); - # construct orthogonal basis U of Krylov subspace; - # span([v Av A^2*v ... A^(k+1)*v]); - # via householder reflections; reflections are multiplied to obtain U - # inputs: - # A: square matrix - # v: column vector - # k: desired krylov subspace dimension (as above) - # eps1: threshhold for 0 relative to norm of current column (default: 1e-12) - # pflg: permutation flag (default 0): avoid using zero rows of - # [A,v] as householder pivots; this avoids spurious non-zero entries - # in returned orthogonal matrix U, but destroys the Householder matrix - # structure of H. - # outputs: - # U: (n x k+1) orthogonal basis of Krylov subspace. A*U(:,1:k) = U*H - # H: (pflg=0): Hessenberg matrix satisfying A*U(:,1:k) = U*H - # (pflg=1): Workspace; does not satisfy above equation. - # k1: dimension of span of krylov subspace (based on eps1) - # if k > m-1, krylov returns the Hessenberg decompostion of A. + [m,kb] = size(V); + if(m != na); + error("A(%d x %d), V(%d x %d): argument dimensions do not match", ... + na,na,m,kb) + endif - # Written by A. S. Hodel 1992 - # $Revision: 1.2 $ - # $Log$ - - save_empty_list_elements_ok = empty_list_elements_ok; - empty_list_elements_ok = 1; + if( !is_scalar(k) ) + error("krylov: third argument must be a scalar integer") + endif - if (nargin > 5) usage("[U,H,k1] = krylov(A,v,k{,eps1,pflg})"); - elseif(nargin < 5) pflg = 0; - elseif(nargin < 4) eps1 = 1e-12; endif - na = is_square(A); - if(!na) error("krylov: A(%dx%d) must be square",na,na); endif - [m,n] = size(v); - if(!is_vector(v)) error("krylov: v(%dx%d) must be a vector",m,n); - elseif(length(v) != na) - error("krylov: A(%dx%d), v(%dx1); mismatch",na,na,length(v)); - endif - v = vec(v); # make sure it's a column vector - if(!is_scalar(k)) - error("krylov: k(%dx%d) must be a scalar",rows(k), columns(k)); - elseif( k > m) - warning("krylov: k is too large; reducing to %d",m-1); - k = m-1; + Vnrm = norm(V,Inf); + + # check for trivial solution + if(Vnrm == 0) + Uret = []; nu = 0; return; endif - # check for zero input vector - if(norm(v) == 0) U = []; H = []; k1 = 0; return endif + # identify trivial null space + abm = max(abs([A,V]')); nzidx = find(abm != 0); zidx = find(abm == 0); + + # set up vector of pivot points + pivot_vec = 1:na; - # indices of legal pivot points (identifies trivial null space). - abm = max(abs([A,v]')); nzidx = find(abm != 0); zidx = find(abm == 0); + iter = 0; + alpha = []; + nh = 0; + while (length(alpha) < na) & (columns(V) > 0) & (iter < k) + iter++; - # check permutation flag - if(pflg) - # permute zero rows of [A,v] to trailing rows - permvec = [vec(nzidx); vec(zidx)]; - pmat = eye(na); pmat = pmat(permvec,:); - ipermvec = pmat'*vec(1:na); - A = A(permvec,permvec); - v = v(permvec); - endif + # get orthogonal basis of V + jj = 1; + while(jj <= columns(V) & length(alpha) < na) + nu = length(alpha)+1; # index of next Householder reflection + + short_pv = pivot_vec(nu:na); + q = V(:,jj); + short_q = q(short_pv); - k1 = k+1; # Assume subspace basis has full rank - [m,n] = size(A); - [hv,alpha(1),z] = housh(v,1,0); - - # initial orthogonal vector - q = zeros(n,1); - q(1) = 1; - q = q - alpha*hv*hv'*q; - normq = norm(q); - normres = normq; + if(norm(short_q) < eps1) + # insignificant column; delete + nv = columns(V); + if(jj != nv) + [V(:,jj),V(:,nv)] = swap(V(:,jj),V(:,nv)); + # FIX ME: H columns should be swapped too. Not done since + # Block Hessenberg structure is lost anyway. + endif + V = V(:,1:(nv-1)); + nu = nu - 1; # one less reflection - U(:,1) = hv; - j = 1; - while(j <= k & normres > eps1*normq) - # multiply to get new vector; - q = A*q; - normq = norm(q); + else + # new householder reflection + if(pflg) + # locate max magnitude element in short_q + asq = abs(short_q); + maxv = max(asq); + maxidx = find(asq == maxv); + pivot_idx = short_pv(maxidx(1)); + + # see if need to change the pivot list + if(pivot_idx != pivot_vec(nu)) + swapidx = maxidx(1) + (nu-1); + [pivot_vec(nu),pivot_vec(swapidx)] = ... + swap(pivot_vec(nu),pivot_vec(swapidx)); + endif + endif + + # isolate portion of vector for reflection + idx = pivot_vec(nu:na); + jdx = pivot_vec(1:nu); + + [hv,av,z] = housh(q(idx),1,0); + alpha(nu) = av; + U(idx,nu) = hv; - # multiply by householder reflections to obtain projected vector and the - # next column of H - for i=1:j - hv = U(i:n,i); - av = alpha(i); - q(i:n,1) = q(i:n,1)-av*hv*(hv'*q(i:n,1)); - endfor + # reduce V per the reflection + V(idx,:) = V(idx,:) - av*hv*(hv' * V(idx,:)); + if(iter > 1) + # FIX ME: not done correctly for block case + H(nu,nu-1) = V(pivot_vec(nu),jj); + endif + + # advance to next column of V + jj=jj+1; + endif + endwhile - i = j+1; - # compute and apply next householder vector; - if(i <= n) - [hv,av,z] = housh(q(i:n,1),1,0); - alpha(i) = av; - q(i:n,1) = q(i:n,1)-av*hv*(hv'*q(i:n,1)); - U(i:n,i) = hv; - H(1:i,j) = q(1:i); - else - av = 0; - H(:,j) = q; # complete Hessenberg decomposition + if(columns(V) > 0) + # construct next Q and multiply + Q = zeros(size(V)); + for kk=1:columns(Q) + Q(pivot_vec(nu-columns(Q)+kk),kk) = 1; + endfor + + # apply Householder reflections + for ii = nu:-1:1 + idx = pivot_vec(ii:na); + hv = U(idx,ii); + av = alpha(ii); + Q(idx,:) = Q(idx,:) - av*hv*(hv'*Q(idx,:)); + endfor endif - # see if done yet - normres = norm(q(i:n)); - if(normres > eps1*normq) - j = j+1; - else - k1 = min(k1,j); # time to quit; norm of residual is small - endif - - # back out new q vector for next pass; - j1 = columns(U); - q = zeros(n,1); - q(j1) = 1; - for i=j1:-1:1; - hv = U(i:n,i); - av = alpha(i); - q(i:n,1) = q(i:n,1)-av*hv*(hv'*q(i:n,1)); - endfor + # multiply to get new vector; + V = A*Q; + # project off of previous vectors + nu = length(alpha); + for i=1:nu + hv = U(:,i); av = alpha(i); + V = V - av*hv*(hv'*V); + H(i,nu-columns(V)+(1:columns(V))) = V(pivot_vec(i),:); + end + endwhile + # Back out complete U matrix # back out U matrix ; j1 = columns(U); for i=j1:-1:1; - hv = U(i:n,i); - av = alpha(i); - U(:,i) = zeros(n,1); - U(i,i) = 1; - U(i:n,i:j1) = U(i:n,i:j1)-av*hv*(hv'*U(i:n,i:j1)); + idx = pivot_vec(i:na); + hv = U(idx,i); + av = alpha(i); + U(:,i) = zeros(na,1); + U(idx(1),i) = 1; + U(idx,i:j1) = U(idx,i:j1)-av*hv*(hv'*U(idx,i:j1)); endfor - - # check permutation flag - if(pflg) - # permute rows of U back to original coordinates - U = U(ipermvec,:); - endif - - # check for spurious nonzero entries - if( max(max( abs(U(zidx,:)) )) > eps1 ) + + nu = length(alpha); + Uret = U; + if( max(max( abs(Uret(zidx,:)) )) > 0) warning("krylov: trivial null space corrupted; set pflg=1 or eps1>%e",eps1); endif - empty_list_elements_ok = save_empty_list_elements_ok; - endfunction diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/linear-algebra/krylovb.m --- a/scripts/linear-algebra/krylovb.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/linear-algebra/krylovb.m Wed Apr 07 18:34:20 1999 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 1993, 1998 A. Scottedward Hodel +# Copyright (C) 1993, 1998, 1999 A. Scottedward Hodel # # This file is part of Octave. # @@ -16,78 +16,32 @@ # along with Octave; see the file COPYING. If not, write to the Free # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -function [Uret,Ucols] = krylovb(A,V,k,eps1); - # function [U,Ucols] = krylovb(A,V,k[,eps1]); +function [Uret,Ucols] = krylovb(A,V,k,eps1,pflg); + # function [U,Ucols] = krylovb(A,V,k{,eps1,pflg}); # construct orthogonal basis U of block Krylov subspace; # [V AV A^2*V ... A^(k+1)*V]; # method used: householder reflections to guard against loss of # orthogonality # eps1: threshhold for 0 (default: 1e-12) - # + # pflg: permutation flag # outputs: # returned basis U is orthogonal matrix; due to "zeroed" # columns of product, may not satisfy A U = U H identity # Ucols: dimension of span of krylov subspace (based on eps1) # if k > m-1, krylov returns the Hessenberg decompostion of A. -# -# A. S. Hodel Feb 1993 -# $Revision$ -# $Log$ - - if(nargin == 3) - eps1 = 1e-12; - endif - na = is_square(A); - if( !na ) - error("krylov: first argument must be a square matrix") - endif - - [m,kb] = size(V); - if(m != na); - error("krylov: argument dimensions do not match") - endif - - if( !is_scalar(k) ) - error("krylov: third argument must be a scalar integer") - endif - - Vnrm = norm(V,Inf); - - # compute factored QR - [U,alpha,kb] = qrhouse(V,eps1*Vnrm); - Q = krygetq(U,alpha,kb); - Uret = Q; - Ucols = kb; + # + # Note: krylovb directly calls and is superseded by krylov. - iter = 0; - while (Ucols < na) & (kb > 0) & (iter < k) - iter++; - # multiply to get new vector; - V = A*Q; + switch(nargin) + case(3), + [Uret,H,Ucols] = krylov(A,V,k); + case(4), + [Uret,H,Ucols] = krylov(A,V,k,eps1); + case(5), + [Uret,H,Ucols] = krylov(A,V,k,eps1,pflg); + otherwise, + usage("[Uret,Ucols] = krylovb(A,V,k{,eps1,pflg}); %d arguments passed", ... + nargin); + endswitch - # project off of previous vectors - nzv = []; # set of reflection indices used so far - nj = length(alpha); - for i=1:nj - hv = U(:,i); - nzidx = find(hv != 0); # extract nonzero entries - nzv = union(nzv,nzidx(1)); # save for call to qrhouse - hv = hv(nzidx); - vr = V(nzidx,:); - av = alpha(i); - V(nzidx,:) = vr - (av*hv)*(hv'*vr); - end - V(nzv,:) = 0; # clear entries covered by earlier reflections - - [hvk,alphk,kb] = qrhouse(V,eps1*Vnrm); # now get new QR factorization - if(kb > 0) - U = [U,hvk]; # append new data to Householder data structure - alpha = [alpha;alphk]; - Q2 = krygetq(U,alpha,kb); - Uret = [Uret,Q2]; - - Ucols = Ucols + kb; - Q = Q2; - end - end endfunction diff -r d54ef0aa6e82 -r 2e74d8aa1a20 scripts/strings/index.m --- a/scripts/strings/index.m Sat Mar 27 17:40:46 1999 +0000 +++ b/scripts/strings/index.m Wed Apr 07 18:34:20 1999 +0000 @@ -39,8 +39,12 @@ if (isstr (s) && isstr (t)) - l_s = length (s); - l_t = length (t); + [nr_s, l_s] = size (s); + [nr_t, l_t] = size (t); + + if (nr_s != 1 || nr_t != 1) + error ("index: arguments cannot be string arrays"); + endif if (l_t <= l_s) tmp = l_s - l_t + 1; diff -r d54ef0aa6e82 -r 2e74d8aa1a20 src/ov.h --- a/src/ov.h Sat Mar 27 17:40:46 1999 +0000 +++ b/src/ov.h Wed Apr 07 18:34:20 1999 +0000 @@ -222,7 +222,7 @@ return *this; } - int count (void) { return rep->count; } + int get_count (void) { return rep->count; } virtual type_conv_fcn numeric_conversion_function (void) const { return rep->numeric_conversion_function (); } diff -r d54ef0aa6e82 -r 2e74d8aa1a20 src/symtab.cc --- a/src/symtab.cc Sat Mar 27 17:40:46 1999 +0000 +++ b/src/symtab.cc Wed Apr 07 18:34:20 1999 +0000 @@ -53,7 +53,7 @@ { octave_stdout << "symbol_def::count: " << count << "\n"; octave_stdout << "def.type_name(): " << definition.type_name () << "\n"; - octave_stdout << "def.count(): " << definition.count () << "\n"; + octave_stdout << "def.count(): " << definition.get_count () << "\n"; } // Individual records in a symbol table. diff -r d54ef0aa6e82 -r 2e74d8aa1a20 src/version.h --- a/src/version.h Sat Mar 27 17:40:46 1999 +0000 +++ b/src/version.h Wed Apr 07 18:34:20 1999 +0000 @@ -23,7 +23,7 @@ #if !defined (octave_version_h) #define octave_version_h 1 -#define OCTAVE_VERSION "2.1.13" +#define OCTAVE_VERSION "2.1.14" #define OCTAVE_COPYRIGHT \ "Copyright (C) 1996, 1997, 1998 John W. Eaton."