From: Kevin M. Rosenberg Date: Wed, 28 Jun 2000 15:25:34 +0000 (+0000) Subject: r123: *** empty log message *** X-Git-Tag: debian-4.5.3-3~894 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=3e346e67f7f7a331919a32439b0f54a4d53d3029 r123: *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index ee0e059..93df882 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1.9.9 - 6/29/00 + Fixed const issue with ImageFileArray + Fixed Array2dFile::labelsCopy() + Added copy constructor and assignment for Array2dFileLabel class + Added Timer to if-2.cpp and ifinfo.cpp + 1.9.8 - 6/27/2000 Rewrote Array2dFile class to be non-templated Rewrote Array2dFile class to make reads and writes atomic. No disk files are kept open. diff --git a/configure b/configure index c4db024..b120121 100755 --- a/configure +++ b/configure @@ -711,7 +711,7 @@ fi PACKAGE=ctsim -VERSION=1.9.8 +VERSION=1.9.9 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -2819,17 +2819,21 @@ else fi +echo $ac_n "checking debug""... $ac_c" 1>&6 +echo "configure:2824: checking debug" >&5 # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" case "${enableval}" in yes) debug=true - CFLAGS="$CFLAGS -g" + CFLAGS="-g -DDEBUG" + echo "$ac_t""yes" 1>&6 ;; no) debug=false - CFLAGS="$CFLAGS -O2" + echo "$ac_t""no" 1>&6 + CFLAGS="-g -O" ;; - *) { echo "configure: error: bad value ${enableval} for --enable-debug" 1>&2; exit 1; } + *) echo "$ac_t""bad value ${enableval} for --enable-debug" 1>&6 ;; esac else @@ -2862,7 +2866,7 @@ if test "$withval" != "no" ; then fi echo $ac_n "checking for LAM MPI installation""... $ac_c" 1>&6 -echo "configure:2866: checking for LAM MPI installation" >&5 +echo "configure:2870: checking for LAM MPI installation" >&5 for testlamdir in "." $trylamdir /usr/local /usr/local/lam /usr /usr/lam /opt /opt/lam ; do if test -x "$testlamdir/bin/hcc" ; then LDFLAGS="$LDFLAGS -L$testlamdir/lib" @@ -2880,7 +2884,7 @@ else fi echo $ac_n "checking for web access""... $ac_c" 1>&6 -echo "configure:2884: checking for web access" >&5 +echo "configure:2888: checking for web access" >&5 # Check whether --with-cgibin-dir or --without-cgibin-dir was given. if test "${with_cgibin_dir+set}" = set; then withval="$with_cgibin_dir" @@ -2970,7 +2974,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:2974: checking for X" >&5 +echo "configure:2978: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -3032,12 +3036,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3045: \"$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* @@ -3106,14 +3110,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -3219,17 +3223,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:3223: checking whether -R must be followed by a space" >&5 +echo "configure:3227: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -3245,14 +3249,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -3284,7 +3288,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:3288: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:3292: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3292,7 +3296,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3311: \"$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 @@ -3325,7 +3329,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:3329: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:3333: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3333,7 +3337,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3352: \"$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 @@ -3373,12 +3377,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:3377: checking for gethostbyname" >&5 +echo "configure:3381: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+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${ac_exeext}; then +if { (eval echo configure:3409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -3422,7 +3426,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:3426: checking for gethostbyname in -lnsl" >&5 +echo "configure:3430: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3430,7 +3434,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3449: \"$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 @@ -3471,12 +3475,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:3475: checking for connect" >&5 +echo "configure:3479: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+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${ac_exeext}; then +if { (eval echo configure:3507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -3520,7 +3524,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:3524: checking for connect in -lsocket" >&5 +echo "configure:3528: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3528,7 +3532,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3547: \"$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 @@ -3563,12 +3567,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:3567: checking for remove" >&5 +echo "configure:3571: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+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${ac_exeext}; then +if { (eval echo configure:3599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -3612,7 +3616,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:3616: checking for remove in -lposix" >&5 +echo "configure:3620: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3620,7 +3624,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3639: \"$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 @@ -3655,12 +3659,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:3659: checking for shmat" >&5 +echo "configure:3663: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+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${ac_exeext}; then +if { (eval echo configure:3691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -3704,7 +3708,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:3708: checking for shmat in -lipc" >&5 +echo "configure:3712: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3712,7 +3716,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3731: \"$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 @@ -3756,7 +3760,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:3760: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:3764: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3764,7 +3768,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3783: \"$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 @@ -3812,7 +3816,7 @@ X_BASIC_LIBS="-lXext -lX11" our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" echo $ac_n "checking for XtToolkitThreadInitialize in -lXt""... $ac_c" 1>&6 -echo "configure:3816: checking for XtToolkitThreadInitialize in -lXt" >&5 +echo "configure:3820: checking for XtToolkitThreadInitialize in -lXt" >&5 ac_lib_var=`echo Xt'_'XtToolkitThreadInitialize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3820,7 +3824,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXt $X_PRE_LIBS $X_BASIC_LIBS $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3839: \"$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 @@ -3859,7 +3863,7 @@ LDFLAGS="$our_saved_LDFLAGS" our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" echo $ac_n "checking for XdbeQueryExtension in -lXext""... $ac_c" 1>&6 -echo "configure:3863: checking for XdbeQueryExtension in -lXext" >&5 +echo "configure:3867: checking for XdbeQueryExtension in -lXext" >&5 ac_lib_var=`echo Xext'_'XdbeQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3867,7 +3871,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXext -lX11 "$X_EXTRA_LIBS" $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3886: \"$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 @@ -3902,7 +3906,7 @@ else fi echo $ac_n "checking for XmbufQueryExtension in -lXext""... $ac_c" 1>&6 -echo "configure:3906: checking for XmbufQueryExtension in -lXext" >&5 +echo "configure:3910: checking for XmbufQueryExtension in -lXext" >&5 ac_lib_var=`echo Xext'_'XmbufQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3910,7 +3914,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXext -lX11 "$X_EXTRA_LIBS" $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3929: \"$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 @@ -3951,17 +3955,17 @@ for ac_hdr in X11/extensions/Xdbe.h X11/extensions/multibuf.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3955: checking for $ac_hdr" >&5 +echo "configure:3959: 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:3965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3969: \"$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* @@ -4003,7 +4007,7 @@ my_includes="$my_includes -I../include -I.." echo $ac_n "checking interactive graphics""... $ac_c" 1>&6 -echo "configure:4007: checking interactive graphics" >&5 +echo "configure:4011: checking interactive graphics" >&5 if test "$no_x" != "yes" ; then cat >> confdefs.h <<\EOF #define HAVE_X11 1 diff --git a/configure.in b/configure.in index 947c976..5f43602 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Must reset CDPATH so that bash's cd does not print to stdout dnl CDPATH= AC_INIT(src/pjrec.cpp) -AM_INIT_AUTOMAKE(ctsim,1.9.8) +AM_INIT_AUTOMAKE(ctsim,1.9.9) AM_CONFIG_HEADER(config.h) dnl Checks for programs. @@ -12,7 +12,7 @@ AC_PROG_AWK AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB -AC_PROG_CC +AC_PROG_CC([-g]) AC_PROG_CXX @@ -137,18 +137,22 @@ AC_ARG_ENABLE(verbose-warnings, ) dnl Check for debug mode +AC_MSG_CHECKING([debug]) AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging], [case "${enableval}" in yes) debug=true - CFLAGS="$CFLAGS -g" + CFLAGS="-g -DDEBUG" + AC_MSG_RESULT(yes) ;; no) debug=false - CFLAGS="$CFLAGS -O2" + AC_MSG_RESULT(no) + CFLAGS="-g -O" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) + *) AC_MSG_RESULT([bad value ${enableval} for --enable-debug]) ;; -esac],[debug=false]) +esac], +[debug=false]) AM_CONDITIONAL(DEBUG, test "$debug" = "true") dnl Set LAM path diff --git a/include/array2dfile.h b/include/array2dfile.h index 05d7b85..8104129 100644 --- a/include/array2dfile.h +++ b/include/array2dfile.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.h,v 1.2 2000/06/27 10:48:11 kevin Exp $ +** $Id: array2dfile.h,v 1.3 2000/06/28 15:25:34 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -83,9 +83,11 @@ public: const string& getDateString () const; - // Array2dFileLabel (const Array2dFileLabel&); + void print (ostream& os) const; - // Array2dFileLabel& operator= (const Array2dFileLabel&); + Array2dFileLabel (const Array2dFileLabel& rhs); + + Array2dFileLabel& operator= (const Array2dFileLabel& rhs); private: void init (void); diff --git a/include/ctsupport.h b/include/ctsupport.h index f180091..58274ee 100644 --- a/include/ctsupport.h +++ b/include/ctsupport.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsupport.h,v 1.4 2000/06/22 10:17:28 kevin Exp $ +** $Id: ctsupport.h,v 1.5 2000/06/28 15:25:34 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -149,9 +149,13 @@ typedef unsigned char kuint8; #endif -/* filefuncs.cpp */ -bool fileExists (const char* fname); -const char* fileBasename (const char* filename); +inline const char* +fileBasename (const char* const filename) +{ + const char* p = strrchr (filename, '/'); + return (p ? p + 1 : filename); +} + /* strfuncs.cpp */ char* str_skip_head(const char* str, const char* const charlist); diff --git a/include/imagefile.h b/include/imagefile.h index c5a68e7..ef60d3d 100644 --- a/include/imagefile.h +++ b/include/imagefile.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: imagefile.h,v 1.15 2000/06/26 21:15:24 kevin Exp $ +** $Id: imagefile.h,v 1.16 2000/06/28 15:25:34 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -61,7 +61,7 @@ public: kfloat32** getArray (void) { return (kfloat32**) (m_arrayData); } - const kfloat32** getArray (void) const + const kfloat32* const * getArray (void) const { return (const kfloat32**) (m_arrayData); } #ifdef HAVE_MPI @@ -94,7 +94,7 @@ class F64Image : public Array2dFile kfloat64** getArray (void) { return (kfloat64**) (m_arrayData); } - const kfloat64** getArray (void) const + const kfloat64* const * getArray (void) const { return (const kfloat64**) (m_arrayData); } #ifdef HAVE_MPI @@ -112,11 +112,13 @@ typedef F64Image ImageFileBase; typedef kfloat64 ImageFileValue; typedef kfloat64* ImageFileColumn; typedef kfloat64** ImageFileArray; +typedef const kfloat64* const * ImageFileArrayConst; #else typedef F32Image ImageFileBase; typedef kfloat32 ImageFileValue; typedef kfloat32* ImageFileColumn; typedef kfloat32** ImageFileArray; +typedef const kfloat32* const * ImageFileArrayConst; #endif diff --git a/libctsim/array2dfile.cpp b/libctsim/array2dfile.cpp index 315ff46..d260320 100644 --- a/libctsim/array2dfile.cpp +++ b/libctsim/array2dfile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.cpp,v 1.2 2000/06/27 10:48:11 kevin Exp $ +** $Id: array2dfile.cpp,v 1.3 2000/06/28 15:25:34 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -60,7 +60,7 @@ Array2dFileLabel::Array2dFileLabel() } Array2dFileLabel::Array2dFileLabel(const char* const str, double ctime = 0.) - : m_strLabel (str) + : m_strLabel (str) { init(); @@ -113,6 +113,45 @@ Array2dFileLabel::getDateString (void) const } +Array2dFileLabel::Array2dFileLabel (const Array2dFileLabel& rhs) +{ + m_calcTime = rhs.m_calcTime; + m_labelType = rhs.m_labelType; + m_strLabel = rhs.m_strLabel; + m_year = rhs.m_year; m_month = rhs.m_month; m_day = rhs.m_day; + m_hour = rhs.m_hour; m_minute = rhs.m_minute; m_second = rhs.m_second; +} + +Array2dFileLabel& +Array2dFileLabel::operator= (const Array2dFileLabel& rhs) +{ + m_calcTime = rhs.m_calcTime; + m_labelType = rhs.m_labelType; + m_strLabel = rhs.m_strLabel; + m_year = rhs.m_year; m_month = rhs.m_month; m_day = rhs.m_day; + m_hour = rhs.m_hour; m_minute = rhs.m_minute; m_second = rhs.m_second; + + return (*this); +} + +void +Array2dFileLabel::print (ostream& os) const +{ + if (m_labelType == L_HISTORY) { + os << "History: " << endl; + os << " " << m_strLabel << endl; + os << " calc time = " << m_calcTime << " secs" << endl; + os << " Timestamp = " << getDateString() << endl; + } else if (m_labelType == L_USER) { + os << "Note: " << m_strLabel << endl; + os << " Timestamp = %s" << getDateString() << endl; + } else { + os << "Unknown (" << m_labelType << "): " << m_strLabel << endl; + os << " Timestamp = %s" << getDateString() << endl; + } +} + + /////////////////////////////////////////////////////////////////////////// // CLASS IMPLEMENTATION // @@ -502,6 +541,8 @@ Array2dFile::labelsCopy (Array2dFile& copyFile, const char* const idStr) string id = idStr; for (int i = 0; i < copyFile.getNumLabels(); i++) { Array2dFileLabel l = copyFile.labelGet (i); + copyFile.labelGet(i).print(cout); + l.print(cout); string lstr = l.getLabelString(); lstr = idStr + lstr; l.setLabelString (lstr); @@ -527,16 +568,8 @@ Array2dFile::printLabels (ostream& os) const for (constLabelIterator l = m_labels.begin(); l != m_labels.end(); l++) { const Array2dFileLabel& label = **l; - if (label.getLabelType() == Array2dFileLabel::L_HISTORY) { - os << "History: " << endl; - os << " " << label.getLabelString() << endl; - os << " calc time = " << label.getCalcTime() << " secs" << endl; - os << " Timestamp = " << label.getDateString() << endl; - } else if (label.getLabelType() == Array2dFileLabel::L_USER) { - os << "Note: " << label.getLabelString() << endl; - os << " Timestamp = %s" << label.getDateString() << endl; - } - os << endl; + label.print (os); + os << endl; } } diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index a05eae7..c3d2f67 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: imagefile.cpp,v 1.5 2000/06/26 21:15:24 kevin Exp $ +** $Id: imagefile.cpp,v 1.6 2000/06/28 15:25:34 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -112,8 +112,8 @@ ImageFile::comparativeStatistics (const ImageFile& imComp, double& d, double& r, sys_error (ERR_WARNING, "Image sizes differ [ImageFile::comparativeStatistics]"); return false; } - const ImageFileArray const v = getArray(); - ImageFileArray vComp = imComp.getArray(); + ImageFileArrayConst v = getArray(); + ImageFileArrayConst vComp = imComp.getArray(); double myMean = 0.; for (int ix = 0; ix < m_nx; ix++) { @@ -194,7 +194,7 @@ ImageFile::statistics (double& min, double& max, double& mean, double& mode, dou { int nx = m_nx; int ny = m_ny; - const ImageFileArray v = getArray(); + ImageFileArrayConst v = getArray(); mean = 0; min = v[0][0]; diff --git a/libctsupport/Makefile.am b/libctsupport/Makefile.am index 57a3fb3..3d964e8 100644 --- a/libctsupport/Makefile.am +++ b/libctsupport/Makefile.am @@ -1,6 +1,6 @@ noinst_LIBRARIES = libctsupport.a INCLUDES=@my_includes@ -libctsupport_a_SOURCES= filefuncs.cpp strfuncs.cpp syserror.cpp fnetorderstream.cpp consoleio.cpp mathfuncs.cpp xform.cpp clip.cpp +libctsupport_a_SOURCES= strfuncs.cpp syserror.cpp fnetorderstream.cpp consoleio.cpp mathfuncs.cpp xform.cpp clip.cpp EXTRA_DIST=Makefile.nt diff --git a/libctsupport/filefuncs.cpp b/libctsupport/filefuncs.cpp deleted file mode 100644 index ab26634..0000000 --- a/libctsupport/filefuncs.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************************** -** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg -** -** $Id: filefuncs.cpp,v 1.3 2000/06/22 10:17:28 kevin Exp $ -** -** Revision 1.1.1.1 2000/04/28 13:02:44 kevin -** Initial CVS import for first public release -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License (version 2) as -** published by the Free Software Foundation. -** -** 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 - -******************************************************************************/ - -#include -#include -#include -#include -#include "ctsupport.h" - - -const char* -fileBasename (const char* const filename) -{ - const char* p = strrchr (filename, '/'); - return (p ? p + 1 : filename); -} - - -/* NAME - * fileExists Checks if a specified disk fie exists - * - * SYNOPSIS - * exist = fileExists (fname) - * bool exist TRUE if specified file exists - */ - -bool -fileExists (const char *fname) -{ - FILE *fp; - bool exist; - - if (strlen(fname) == 0) - exist = false; - else if ((fp = fopen(fname, "r")) == NULL) - exist = false; - else { - fclose (fp); - exist = true; - } - - return (exist); -} - diff --git a/src/if-2.cpp b/src/if-2.cpp index cbf0e79..545920a 100644 --- a/src/if-2.cpp +++ b/src/if-2.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: if-2.cpp,v 1.8 2000/06/26 21:15:24 kevin Exp $ +** $Id: if-2.cpp,v 1.9 2000/06/28 15:25:34 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -30,6 +30,7 @@ */ #include "ct.h" +#include "timer.h" enum {O_ADD, O_SUB, O_MUL, O_COMP, O_VERBOSE, O_HELP, O_VERSION}; @@ -78,6 +79,8 @@ if2_main (int argc, char *const argv[]) int opt_mul = 0; int opt_comp = 0; + Timer timerProgram; + while (1) { int c = getopt_long (argc, argv, "", my_options, NULL); @@ -200,7 +203,7 @@ if2_main (int argc, char *const argv[]) im_out.labelsCopy (im_in1, "if-2 file 1: "); im_out.labelsCopy (im_in2, "if-2 file 2: "); - im_out.labelAdd (Array2dFileLabel::L_HISTORY, strOperation.c_str()); + im_out.labelAdd (Array2dFileLabel::L_HISTORY, strOperation.c_str(), timerProgram.timerEnd()); im_out.fileWrite(out_file); diff --git a/src/pj2if.cpp b/src/pj2if.cpp index 8723429..25b72ca 100644 --- a/src/pj2if.cpp +++ b/src/pj2if.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: pj2if.cpp,v 1.5 2000/06/27 10:48:11 kevin Exp $ +** $Id: pj2if.cpp,v 1.6 2000/06/28 15:25:34 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -33,6 +33,7 @@ */ #include "ct.h" +#include "timer.h" enum { O_VERBOSE, O_HELP, O_VERSION }; @@ -63,10 +64,10 @@ int pj2if_main (const int argc, char *const argv[]) { char *pj_name, *im_name; - int ix, iy; - bool opt_verbose = false; + bool optVerbose = false; extern int optind; - + Timer timerProgram; + while (1) { int c = getopt_long (argc, argv, "", my_options, NULL); @@ -76,7 +77,7 @@ pj2if_main (const int argc, char *const argv[]) switch (c) { case O_VERBOSE: - opt_verbose = true; + optVerbose = true; break; case O_VERSION: #ifdef VERSION @@ -109,25 +110,25 @@ pj2if_main (const int argc, char *const argv[]) return (1); } - if (opt_verbose) + if (optVerbose) pj.printScanInfo(); ImageFile im (pj.nDet(), pj.nView()); ImageFileArray v = im.getArray(); - for (iy = 0; iy < pj.nView(); iy++) + for (int iy = 0; iy < pj.nView(); iy++) { DetectorArray& detarray = pj.getDetectorArray (iy); const DetectorValue* detval = detarray.detValues(); - for (ix = 0; ix < pj.nDet(); ix++) + for (int ix = 0; ix < pj.nDet(); ix++) { v[ix][iy] = detval[ix]; } } im.labelAdd (pj.getLabel()); - im.labelAdd (Array2dFileLabel::L_HISTORY, "Conversion from .pj to .if"); + im.labelAdd (Array2dFileLabel::L_HISTORY, "Conversion from .pj to .if", timerProgram.timerEnd()); im.fileWrite (im_name); return(0);