mistat-cvs Mailing List for mistat
Status: Pre-Alpha
Brought to you by:
bikepunk005
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(7) |
Mar
(17) |
Apr
(10) |
May
(19) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: Mike H. B. <bik...@us...> - 2004-07-05 04:30:28
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27484 Modified Files: .indent.pro Makefile.am Makefile.in file_ops.c file_ops.h main.c menu.c menu.h output.c statistics.c statistics.h system.h Added Files: input.h Log Message: Removed libtecla, now using readline. Put all file operations in file_ops.c. Finished regression work. Index: .indent.pro =================================================================== RCS file: /cvsroot/mistat/mistat/src/.indent.pro,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .indent.pro 9 Jun 2004 17:00:05 -0000 1.1 --- .indent.pro 5 Jul 2004 04:28:57 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + +verbose +blank-lines-after-procedures +brace-indent0 /*0 from 2*/ *************** *** 4,12 **** +braces-after-struct-decl-line +break-before-boolean-operator +continuation-indentation4 /**/ +continue-at-parentheses +declaration-indentation2 +dont-cuddle-else ! +dont-format-comments +dont-format-first-column-comments +else-endif-column1 --- 5,14 ---- +braces-after-struct-decl-line +break-before-boolean-operator + +comment-line-length80 /**/ +continuation-indentation4 /**/ +continue-at-parentheses +declaration-indentation2 +dont-cuddle-else ! +format-all-comments +dont-format-first-column-comments +else-endif-column1 *************** *** 23,25 **** +space-after-cast +space-after-procedure-calls ! +tab-size4 /**/ \ No newline at end of file --- 25,28 ---- +space-after-cast +space-after-procedure-calls ! +tab-size4 /**/ ! -T _Bool \ No newline at end of file --- NEW FILE: input.h --- /* Just find O/S and then include the right source file. ** ** Copyright (C) 2004 Mike H. Benton ** Mike H. Benton <bik...@us...>, 2004. ** ** 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. */ /* * input.h. USAGE: Include in any files that need input from the user. */ #ifdef __CYGWIN__ # include "cygwin_input.c" #endif /* Here ends input.h. */ Index: file_ops.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** file_ops.h 9 Jun 2004 17:00:05 -0000 1.12 --- file_ops.h 5 Jul 2004 04:28:57 -0000 1.13 *************** *** 1,3 **** ! /* Header for file_ops.c in mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** Header for file_ops.c in mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,25 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * file_ops.h USAGE: Doing anything with a file, also when using Nrows or Columns. ! */ #ifndef FILE_OPS_H --- 18,26 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * file_ops.h. USAGE: Doing anything with a file, also when using Nrows or Columns. ! */ #ifndef FILE_OPS_H *************** *** 27,38 **** /* ! * Defines ! */ ! # define MAXLINE 50000 /* Current limit of max. data file lines. */ /* ! * Current limit of max. data file rows (cases)Based on max. number in Excel * 2 + 1. ! */ # define MAXROWS 131073 ! # define MAXCOLS 400 /* Current limit of max. data file cols (variables). */ /* Defines used for Data_Type. */ --- 28,40 ---- /* ! * Defines. ! */ ! # define MAXLINE 50000 /* Current limit of max. data file lines. */ /* ! * Current limit of max. data file rows (cases)Based on max. number in Excel * 2 + 1. ! */ # define MAXROWS 131073 ! # define MAXCOLS 400 /* Current limit of max. data file cols ! (variables). */ /* Defines used for Data_Type. */ *************** *** 42,66 **** /* ! * Prototypes ! */ /*FIXME: why so many?*/ FILE *open_file (char *file_name, int open_mode); void file_close (FILE * fp, char *file_name); void read_data_file (FILE * fp); int getwords (char *line, char *words[], int maxwords); int fgetline (FILE * fp, char line[], int max); void view_log_file (void); void update_logfile (char *message); int getit (FILE * file_name, int element, long double t[]); /* ! * Extern data ! */ ! extern int Nrows; /* Number of rows in data file. */ ! extern int Columns; /* Number of columns in a data file. */ /* ! * Data_Type is an array containing the type of data for each respective variable. ! * 1 is int, 2 is float, 3 is character. ! */ extern int Data_Type[]; --- 44,71 ---- /* ! * Prototypes. ! */ /*FIXME: why so many?*/ FILE *open_file (char *file_name, int open_mode); void file_close (FILE * fp, char *file_name); void read_data_file (FILE * fp); + int getwords (char *line, char *words[], int maxwords); int fgetline (FILE * fp, char line[], int max); + void view_log_file (void); void update_logfile (char *message); int getit (FILE * file_name, int element, long double t[]); + void do_file_menu (int not_read); /* ! * Extern data. ! */ ! extern int Nrows; /* Number of rows in data file. */ ! extern int Columns; /* Number of columns in a data file. */ /* ! * Data_Type is an array containing the type of data for each respective variable. ! * 1 is int, 2 is float, 3 is character. ! */ extern int Data_Type[]; Index: Makefile.in =================================================================== RCS file: /cvsroot/mistat/mistat/src/Makefile.in,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile.in 9 Jun 2004 17:00:05 -0000 1.12 --- Makefile.in 5 Jul 2004 04:28:57 -0000 1.13 *************** *** 1,7 **** ! # Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ ! # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, ! # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, --- 1,7 ---- ! # Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ ! # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 ! # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, *************** *** 35,40 **** # Process with automake to produce Makefile.in. - SOURCES = $(mistat_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ --- 35,38 ---- *************** *** 44,47 **** --- 42,46 ---- pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ *************** *** 57,94 **** PRE_UNINSTALL = : POST_UNINSTALL = : - bin_PROGRAMS = mistat$(EXEEXT) - subdir = src - DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/configure.ac - am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) - mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs - CONFIG_HEADER = $(top_builddir)/config.h - CONFIG_CLEAN_FILES = - am__installdirs = "$(DESTDIR)$(bindir)" - binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) - PROGRAMS = $(bin_PROGRAMS) - am_mistat_OBJECTS = cmdline.$(OBJEXT) error.$(OBJEXT) \ - file_ops.$(OBJEXT) main.$(OBJEXT) menu.$(OBJEXT) \ - output.$(OBJEXT) statistics.$(OBJEXT) memwatch.$(OBJEXT) - mistat_OBJECTS = $(am_mistat_OBJECTS) - mistat_LDADD = $(LDADD) - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) - depcomp = $(SHELL) $(top_srcdir)/config/depcomp - am__depfiles_maybe = depfiles - @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmdline.Po ./$(DEPDIR)/error.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/file_ops.Po ./$(DEPDIR)/main.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/memwatch.Po ./$(DEPDIR)/menu.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/statistics.Po - COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - CCLD = $(CC) - LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ - SOURCES = $(mistat_SOURCES) - DIST_SOURCES = $(mistat_SOURCES) - ETAGS = etags - CTAGS = ctags - DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ --- 56,59 ---- *************** *** 152,156 **** localstatedir = @localstatedir@ mandir = @mandir@ - mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ --- 117,120 ---- *************** *** 160,200 **** sysconfdir = @sysconfdir@ target_alias = @target_alias@ ! mistat_SOURCES = cmdline.c error.c file_ops.c main.c menu.c output.c statistics.c cmdline.h error.h file_ops.h main.h menu.h output.h statistics.h system.h memwatch.c all: all-am .SUFFIXES: .SUFFIXES: .c .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 \ ! && exit 0; \ ! exit 1;; \ ! esac; \ ! done; \ ! echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile ! .PRECIOUS: 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__depfiles_maybe)'; \ ! cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ ! 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 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) ! test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ --- 124,174 ---- sysconfdir = @sysconfdir@ target_alias = @target_alias@ ! ! bin_PROGRAMS = mistat ! mistat_SOURCES = cmdline.c error.c file_ops.c main.c menu.c output.c statistics.c cmdline.h error.h file_ops.h main.h menu.h output.h statistics.h system.h memwatch.c input.h ! subdir = src ! ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ! mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs ! CONFIG_HEADER = $(top_builddir)/config.h ! CONFIG_CLEAN_FILES = ! bin_PROGRAMS = mistat$(EXEEXT) ! PROGRAMS = $(bin_PROGRAMS) ! ! am_mistat_OBJECTS = cmdline.$(OBJEXT) error.$(OBJEXT) file_ops.$(OBJEXT) \ ! main.$(OBJEXT) menu.$(OBJEXT) output.$(OBJEXT) \ ! statistics.$(OBJEXT) memwatch.$(OBJEXT) ! mistat_OBJECTS = $(am_mistat_OBJECTS) ! mistat_LDADD = $(LDADD) ! mistat_DEPENDENCIES = ! mistat_LDFLAGS = ! ! DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) ! depcomp = $(SHELL) $(top_srcdir)/config/depcomp ! am__depfiles_maybe = depfiles ! @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmdline.Po ./$(DEPDIR)/error.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/file_ops.Po ./$(DEPDIR)/main.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/memwatch.Po ./$(DEPDIR)/menu.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/statistics.Po ! COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ ! $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) ! CCLD = $(CC) ! LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ ! DIST_SOURCES = $(mistat_SOURCES) ! DIST_COMMON = $(srcdir)/Makefile.in Makefile.am ! SOURCES = $(mistat_SOURCES) ! all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj ! $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile ! Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ! cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) ! binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) ! $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ *************** *** 202,207 **** ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ ! echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ ! $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done --- 176,181 ---- ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ ! echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ ! $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done *************** *** 211,216 **** @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ ! echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ ! rm -f "$(DESTDIR)$(bindir)/$$f"; \ done --- 185,190 ---- @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ ! echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ ! rm -f $(DESTDIR)$(bindir)/$$f; \ done *************** *** 222,226 **** mostlyclean-compile: ! -rm -f *.$(OBJEXT) distclean-compile: --- 196,200 ---- mostlyclean-compile: ! -rm -f *.$(OBJEXT) core *.core distclean-compile: *************** *** 237,256 **** .c.o: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ --- 211,244 ---- .c.o: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ ! @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ ! @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ ! @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ ! @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ ! @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ ! @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: + ETAGS = etags + ETAGSFLAGS = + + CTAGS = ctags + CTAGSFLAGS = + + tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ *************** *** 261,265 **** END { for (i in files) print i; }'`; \ mkid -fID $$unique - tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ --- 249,252 ---- *************** *** 276,279 **** --- 263,267 ---- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ *************** *** 298,301 **** --- 286,293 ---- distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + + top_distdir = .. + distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) *************** *** 311,315 **** if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ ! $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ --- 303,307 ---- if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ ! $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ *************** *** 329,336 **** check: check-am all-am: Makefile $(PROGRAMS) installdirs: ! for dir in "$(DESTDIR)$(bindir)"; do \ ! test -z "$$dir" || $(mkdir_p) "$$dir"; \ ! done install: install-am install-exec: install-exec-am --- 321,327 ---- check: check-am all-am: Makefile $(PROGRAMS) + installdirs: ! $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-am install-exec: install-exec-am *************** *** 371,376 **** dvi-am: - html: html-am - info: info-am --- 362,365 ---- *************** *** 408,416 **** .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ ! distclean-generic distclean-tags distdir dvi dvi-am html \ ! html-am info info-am install install-am install-binPROGRAMS \ ! install-data install-data-am install-exec install-exec-am \ ! install-info install-info-am install-man install-strip \ ! installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ --- 397,405 ---- .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ ! distclean-generic distclean-tags distdir dvi dvi-am info \ ! info-am install install-am install-binPROGRAMS install-data \ ! install-data-am install-exec install-exec-am install-info \ ! install-info-am install-man install-strip installcheck \ ! installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ Index: system.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/system.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** system.h 9 Jun 2004 17:00:05 -0000 1.7 --- system.h 5 Jul 2004 04:28:57 -0000 1.8 *************** *** 1,3 **** ! /* Shared definitions for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** Shared definitions for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,25 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * system.h USAGE: bool, flags, and MLINE. ! */ #ifndef SYSTEM_H --- 18,26 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * system.h. USAGE: bool, flags, and MLINE. ! */ #ifndef SYSTEM_H *************** *** 35,38 **** --- 36,45 ---- # include <stdbool.h> # else + # if ! HAVE__BOOL + # ifdef __cplusplus + typedef bool _Bool; + # else typedef unsigned char _Bool; + # endif + # endif # define bool _Bool # define false 0 *************** *** 44,57 **** /* ! * Defines ! */ ! # define MLINE 255 /* Maximum input line length. */ /* ! * Variables ! */ ! bool Bell; /* Determine to see if sound system bell. */ bool Log_File_Flag; ! bool bTest; /* Test mode enabled. */ extern bool Data_File_Exist; --- 51,64 ---- /* ! * Defines. ! */ ! # define MLINE 255 /* Maximum input line length. */ /* ! * Variables. ! */ ! bool Bell; /* Determine to see if sound system bell. */ bool Log_File_Flag; ! bool bTest; /* Test mode enabled. */ extern bool Data_File_Exist; Index: statistics.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** statistics.c 9 Jun 2004 17:00:05 -0000 1.35 --- statistics.c 5 Jul 2004 04:28:57 -0000 1.36 *************** *** 1,3 **** ! /* Matrix, vector building, and statistical analysis for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** Matrix, vector building, and statistical analysis for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,66 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * statistics.c USAGE: stats_main must be called to build a vector or matrix that is used for analysis. ! * Then, call the various statistical routines. All routines must be supplied ! * with a boolean value: true for vector, false for matrix. ! * The routines write to supplied array. ! */ #include <stdio.h> #include <stdlib.h> ! #include <math.h> /* For pow and sqrt. */ ! #include <assert.h> /* The error checks. */ ! #include <libmistat/matrix.h> /* Vector and matrix functions. */ ! #include <libmistat/descriptives.h> /* Mean. */ ! #include <libmistat/sort.h> /* Sorts. */ ! #include <libmistat/linear.h> /* Regression. */ ! #include "error.h" /* Calls to error routines (so called custom). */ ! #include "file_ops.h" /* Calls to data file for matrix or vector building, and Data_Type. */ #include "statistics.h" ! #include "main.h" /* Use of data file name from main. */ /* Set up the matrix and vector variables.*/ ! vector_int *vta; /* Vector integer data. */ ! vector_ld *vldta; /* Vector long double data. */ ! matrix_int *mta; /* Matrix integer data. */ ! matrix_ld *mldta; /* Matrix long double data. */ ! bool make_vector (int row); /* Create vector of variable row. */ ! bool make_matrix (int x[], bool type, int how_much); /* Create matrix of variables stored in x. */ /* ! * Populate vector or matrix before calling stat functions. ! * Using as a central call point. ! * Return false if cannot make a vector or matrix. ! */ bool stats_main (int x[], bool vector, bool type, int how_much) { ! int variable; /* Only used in vector. */ ! bool verified; /* Status of making vector or matrix. */ ! verified = false; /* Set as false, called proceures will change to true if succesful. */ ! if (vector) /* Make a vector. */ { variable = x[0]; --- 18,71 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * statistics.c USAGE: stats_main must be called to build a vector or matrix that is used for analysis. ! * Then, call the various statistical routines. All routines must be supplied ! * with a boolean value: true for vector, false for matrix. ! * The routines write to supplied array. ! */ #include <stdio.h> #include <stdlib.h> ! #include <math.h> /* For pow and sqrt. */ ! #include <assert.h> /* The error checks. */ ! #include <libmistat/matrix.h> /* Vector and matrix functions. */ ! #include <libmistat/descriptives.h> /* Mean. */ ! #include <libmistat/sort.h> /* Sorts. */ ! #include <libmistat/linear.h> /* Regression. */ ! #include "error.h" /* Calls to error routines. */ ! #include "file_ops.h" /* Calls to data file for matrix or vector ! building, and Data_Type. */ #include "statistics.h" ! #include "main.h" /* Use of data file name from main. */ /* Set up the matrix and vector variables.*/ ! vector_int *vta; /* Vector integer data. */ ! vector_ld *vldta; /* Vector long double data. */ ! matrix_int *mta; /* Matrix integer data. */ ! matrix_ld *mldta; /* Matrix long double data. */ ! bool make_vector (int row); /* Create vector of variable row. */ ! bool make_matrix (int x[], bool type, int how_much); /* Create matrix of ! variables stored in ! x. */ /* ! * Populate vector or matrix before calling stat functions. ! * Using as a central call point. ! * Return false if cannot make a vector or matrix. ! */ bool stats_main (int x[], bool vector, bool type, int how_much) { ! int variable; /* Only used in vector. */ ! bool verified; /* Status of making vector or matrix. */ ! verified = false; /* Set as false, called proceures will change ! to true if succesful. */ ! if (vector) /* Make a vector. */ { variable = x[0]; *************** *** 70,74 **** } ! else /* Make a matrix. */ { verified = make_matrix (x, type, how_much); --- 75,79 ---- } ! else /* Make a matrix. */ { verified = make_matrix (x, type, how_much); *************** *** 82,93 **** /* ! * Basic statistical functions. ! * Supply is_vector. ! * Return to true/false. ! */ /* ! * Calculates all moments. ! */ bool get_mean (bool is_vector, int for_type, int index, long double results[]) --- 87,98 ---- /* ! * Basic statistical functions. ! * Supply is_vector. ! * Return to true/false. ! */ /* ! * Calculates all moments. ! */ bool get_mean (bool is_vector, int for_type, int index, long double results[]) *************** *** 96,100 **** long double ld_sum; ! if (is_vector) /*Just get moments for one variable. */ { if (Data_Type[for_type] == INT_DATA) --- 101,105 ---- long double ld_sum; ! if (is_vector) /* Just get moments for one variable. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 130,134 **** } ! else /*Get moments from matrix. */ { if (Data_Type[for_type] == INT_DATA) --- 135,139 ---- } ! else /* Get moments from matrix. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 172,176 **** /* ! * Sorted type statistics and tails. */ bool --- 177,181 ---- /* ! * Sorted type statistics and tails. */ bool *************** *** 178,182 **** long double results[]) { ! if (is_vector) /*Process vector data. */ { if (Data_Type[for_type] == INT_DATA) --- 183,187 ---- long double results[]) { ! if (is_vector) /* Process vector data. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 206,210 **** } ! else /*We have a matrix. */ { if (Data_Type[for_type] == INT_DATA) --- 211,215 ---- } ! else /* We have a matrix. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 240,249 **** /* ! * Autocorrelation. */ bool get_auto_cor (bool is_vector, int for_type, int index, long double results[]) { ! if (is_vector) /*Process vector data. */ { if (Data_Type[for_type] == INT_DATA) --- 245,254 ---- /* ! * Autocorrelation. FIXME: Broken at the moment? */ bool get_auto_cor (bool is_vector, int for_type, int index, long double results[]) { ! if (is_vector) /* Process vector data. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 264,268 **** } ! else /*We have a matrix. */ { if (Data_Type[for_type] == INT_DATA) --- 269,273 ---- } ! else /* We have a matrix. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 288,309 **** /* ! int regression_int_matrix (matrix_int * data, int variable_list[], long double *results, int number_cases); ! */ bool regression (bool is_vector, int for_type, int index, long double results[], ! int v[]) { int test; if (is_vector) ! return false; /* Regression only does matrix! */ if (for_type == INT_DATA) { ! test = regression_int_matrix (mta, v, results, Nrows); } else if (for_type == FLOAT_DATA) { ! test = regression_ld_matrix (mldta, v, results, Nrows); } else --- 293,320 ---- /* ! * Perfroms simple regression with and without origin as set by origin. ! */ bool regression (bool is_vector, int for_type, int index, long double results[], ! int v[], int origin) { int test; if (is_vector) ! return false; /* Regression only does matrix! */ if (for_type == INT_DATA) { ! if (origin == 0) ! test = regression_int_matrix (mta, v, results, Nrows); ! else ! test = regression_norig_int_matrix (mta, v, results, Nrows); } else if (for_type == FLOAT_DATA) { ! if (origin == 0) ! test = regression_ld_matrix (mldta, v, results, Nrows); ! else ! test = regression_norig_ld_matrix (mldta, v, results, Nrows); } else *************** *** 318,325 **** /* ! * Fill up vector for analysis. ! * Use var_column is for the particular variable. ! * Returns false if not enough calloc fails. ! */ bool make_vector (int var_column) --- 329,336 ---- /* ! * Fill up vector for analysis. ! * Use var_column is for the particular variable. ! * Returns false if not enough calloc fails. ! */ bool make_vector (int var_column) *************** *** 360,367 **** } ! /*Fill t with data. */ getit (Data_File, var_column, t); ! /*Put t into a vector. */ while (i < Nrows) --- 371,378 ---- } ! /* Fill t with data. */ getit (Data_File, var_column, t); ! /* Put t into a vector. */ while (i < Nrows) *************** *** 391,395 **** i = 0; ! /*Allocate matrix */ if (type == true) --- 402,406 ---- i = 0; ! /* Allocate matrix. */ if (type == true) *************** *** 417,421 **** } ! /*Read data into matrix */ while (i < how_much) { --- 428,432 ---- } ! /* Read data into matrix. */ while (i < how_much) { *************** *** 445,451 **** /* ! * Free allocated vector/matrix. ! * No return. ! */ void free_data (int what_to_free) --- 456,462 ---- /* ! * Free allocated vector/matrix. ! * No return. ! */ void free_data (int what_to_free) Index: file_ops.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** file_ops.c 9 Jun 2004 17:00:05 -0000 1.13 --- file_ops.c 5 Jul 2004 04:28:57 -0000 1.14 *************** *** 1,3 **** ! /* File operations for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** File operations for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,30 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * file_ops.c USAGE: getting there. ! */ #include <errno.h> #include <stdio.h> #include <stdlib.h> ! #include <ctype.h> /* Conversions and class testing. */ #include <string.h> --- 18,31 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * file_ops.c. USAGE: getting there. ! */ #include <errno.h> #include <stdio.h> #include <stdlib.h> ! #include <ctype.h> /* Conversions and class testing. */ #include <string.h> *************** *** 32,47 **** #include "system.h" #include "main.h" ! int Nrows; /* The number of rows in the data file. */ ! int Columns; /* The number of Columns in the data file. */ ! int Data_Type[MAXCOLS]; /* The type of data for each variable. */ void printline (FILE * fp); /* ! * Close file *file_name pointed by to *fp. ! * No return. ! */ void file_close (FILE * fp, char *file_name) --- 33,49 ---- #include "system.h" #include "main.h" + #include "input.h" /* For input routines. */ ! int Nrows; /* The number of rows in the data file. */ ! int Columns; /* The number of Columns in the data file. */ ! int Data_Type[MAXCOLS]; /* The type of data for each variable. */ void printline (FILE * fp); /* ! * Close file *file_name pointed by to *fp. ! * No return. ! */ void file_close (FILE * fp, char *file_name) *************** *** 57,64 **** /* ! * Opens file_name as a file. ! * Returns a file pointer. ! * FIXME: need to add type of flag input ! */ FILE * open_file (char *file_name, int open_mode) --- 59,66 ---- /* ! * Opens file_name as a file. ! * Returns a file pointer. ! * FIXME: need to add type of flag input ! */ FILE * open_file (char *file_name, int open_mode) *************** *** 93,107 **** /* ! * Returns void. ! * Counts the number of cases, and sets VARIABLE_TYPE. ! * Calls fgetline () and getwords(). ! * ! * FIXME: Need to set blank to missing. Need to define missing! Reads data that is not there, as above ! * FIXME: Reads . as a line!!!!! ! */ void read_data_file (FILE * file_name) { ! static FILE *temp_fp; /*used for passing between read functions */ char line[MAXLINE]; char *words[MAXLINE]; --- 95,109 ---- /* ! * Returns void. ! * Counts the number of cases, and sets VARIABLE_TYPE. ! * Calls fgetline () and getwords(). ! * ! * FIXME: Need to set blank to missing. Need to define missing! Reads data that is not there, as above. ! * FIXME: Reads . as a line!!!!! ! */ void read_data_file (FILE * file_name) { ! static FILE *temp_fp; /* Used for passing between read functions. */ char line[MAXLINE]; char *words[MAXLINE]; *************** *** 117,121 **** "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", strerror (errno)); ! Nrows = Columns = -1; /* Set to -1 for error checks elsewhere. */ } --- 119,123 ---- "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", strerror (errno)); ! Nrows = Columns = -1; /* Set to -1 for error checks elsewhere. */ } *************** *** 149,155 **** /* ! * Return the number of words from fgetline(). ! * Replaced \0 with \t in parts. ! */ int --- 151,157 ---- /* ! * Return the number of words from fgetline(). ! * Replaced \0 with \t in parts. ! */ int *************** *** 163,177 **** nwords = 0; ! /* Infinite. Break within. */ while (1) { ! /* Set to false for first run of word. */ is_int = is_float = is_char = false; ! /* If a space, go until not. */ while (isspace (*p)) p++; ! /* If end of line, go home with results. */ if (*p == '\0') return nwords; --- 165,179 ---- nwords = 0; ! /* Infinite. Break within. */ while (1) { ! /* Set to false for first run of word. */ is_int = is_float = is_char = false; ! /* If a space, go until not. */ while (isspace (*p)) p++; ! /* If end of line, go home with results. */ if (*p == '\0') return nwords; *************** *** 214,218 **** } ! /* Set the Data_Type. */ if (is_float == true && Data_Type[location] != CHAR_DATA) { --- 216,220 ---- } ! /* Set the Data_Type. */ if (is_float == true && Data_Type[location] != CHAR_DATA) { *************** *** 232,244 **** } ! /* If end, go back. */ if (*p == '\0') return nwords; ! /* Need and error here. */ if (nwords >= maxwords) return nwords; ! /* We need to go back look at next word. */ p++; } --- 234,246 ---- } ! /* If end, go back. */ if (*p == '\0') return nwords; ! /* Need and error here. */ if (nwords >= maxwords) return nwords; ! /* We need to go back look at next word. */ p++; } *************** *** 248,256 **** /* ! * Gets a line of data from a file. ! * Return EOF if end of file or number of characters. ! * Writes values of line to line[] array. ! * max is maximum line length. ! */ int --- 250,258 ---- /* ! * Gets a line of data from a file. ! * Return EOF if end of file or number of characters. ! * Writes values of line to line[] array. ! * max is maximum line length. ! */ int *************** *** 283,290 **** /* ! * Just shows the log file. ! * Very sloppy for the moment. ! * Need to be more interactive (up/down/copy). ! */ void --- 285,292 ---- /* ! * Just shows the log file. ! * Very sloppy for the moment. ! * Need to be more interactive (up/down/copy). ! */ void *************** *** 299,304 **** /* ! * Currently print a file. ! */ void --- 301,306 ---- /* ! * Currently print a file. ! */ void *************** *** 313,318 **** /* ! * Update the log file. ! */ void --- 315,320 ---- /* ! * Update the log file. ! */ void *************** *** 332,337 **** fprintf (Log_File, "%s", message); ! /* Only need for Cygwin */ ! /* Seems to do no harm in Linux */ if ((fflush (Log_File)) == EOF) { --- 334,339 ---- fprintf (Log_File, "%s", message); ! /* Only need for Cygwin */ ! /* Seems to do no harm in Linux */ if ((fflush (Log_File)) == EOF) { *************** *** 343,355 **** /* ! * Use to read only certain Columns. ! * Fills t[]. Element is column of data set. ! * Returns to be worked out ! */ int getit (FILE * file_name, int element, long double t[]) { ! static FILE *temp_fp; /* Used for passing between read functions. */ char line[MAXLINE]; char *words[MAXLINE]; --- 345,357 ---- /* ! * Use to read only certain Columns. ! * Fills t[]. Element is column of data set. ! * Returns to be worked out ! */ int getit (FILE * file_name, int element, long double t[]) { ! static FILE *temp_fp; /* Used for passing between read functions. */ char line[MAXLINE]; char *words[MAXLINE]; *************** *** 370,374 **** else { - rewind (Data_File); --- 372,375 ---- *************** *** 397,399 **** --- 398,454 ---- } + /* + * Close open file if necessary. + * Get name of file to open and open it! + * This function will also be called from main. + */ + void + do_file_menu (int not_read) + { + char *temp; + + /* Close open data file if necessary. */ + if (Data_File_Exist) + { + file_close (Data_File, Data_File_Name); + Data_File_Exist = false; + } + + temp = readline ("Enter the name of a file or Enter for none\n->"); + + strcpy (Data_File_Name, temp); + + /* Determine if user just hit Enter. */ + if (strlen (Data_File_Name) <= 1) + Data_File_Exist = 0; + + /* We have a file name, now see if it is there. */ + else + { + + Data_File_Name[strlen (Data_File_Name) - 1] = '\0'; + Data_File = open_file (Data_File_Name, 1); + + /* Check to see if opened file. */ + if (Data_File == NULL) + { + Data_File_Exist = false; + printf ("%s not found!\n", Data_File_Name); + } + + /* We have a valid file and it is opened! */ + else + Data_File_Exist = true; + + } + + /* Lastly, read the data file if not called from main. */ + if (!not_read) + { + printf ("Reading the data file\n\n"); + read_data_file (Data_File); + } + + } + /* Here ends file_ops.c. */ Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** output.c 9 Jun 2004 17:00:05 -0000 1.31 --- output.c 5 Jul 2004 04:28:57 -0000 1.32 *************** *** 1,3 **** ! /* Output formatter and printer for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** Output formatter and printer for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,73 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * output.c. USAGE: Go here to get stats and print. ! */ ! #include <stdio.h> /* Various types of printf. */ ! #include <stdlib.h> /* Allocation calls. */ ! #include <string.h> /* Various uses of string functions. */ ! #include <assert.h> /* The error checks. */ ! #include <math.h> /* The log function is used in desc to determine v length. */ ! #include <float.h> /* For use of DBL_DIG. */ #include "output.h" ! #include "statistics.h" /* Calls to statistical routines. */ ! #include "main.h" /* Flag variables (print_digits). */ ! #include "menu.h" /* Enumeration values, and MAX_VAR_INPUT. */ ! #include "file_ops.h" /* Sending data to the Log_File. */ ! #include "system.h" /* Bool and config.h calls; bTest flag. */ - /*FIXME: Need alternate for MSDOS or w/o libtecla. */ - #ifndef MSDOS - # ifdef HAVE_LIBTECLA - # include <libtecla.h> /* Use for input. Use -ltecla for linking. */ - # endif - /* #elif include"myinput.h" */ - #endif /* ! * Variables ! */ ! bool Flag_Vector; /* Vector or matrix (number of variables = 1). */ ! /* FIXME: Consider makeing local and passing. */ ! int Num_Vars; /* Number of variables for analysis. */ ! extern GetLine *gl; /* The getline variable for libtecla. */ ! int Count_Int, Count_Ld; /* Counts of respective types for making a matrix. */ ! int Stop_Me; /* When to stop printing. */ ! int Output_Size; /* Size of output string. */ ! long double Results[20]; /* Results of analysis. */ /* ! * Functions ! */ ! void build_data_list (int v[], int int_count[], int ld_count[]); /* Fill the count vectors. */ ! bool setup_data (int vect_var[], int int_vars[], int ld_vars[]); /* Determine what to make (matrix/vector) and ask to make. */ ! bool desc (bool all_stats, int v[], int matrix_int_vars[], int matrix_ld_vars[]); /* Print descriptive tables. */ bool regress (int stats_to_do, int v[], int matrix_int_vars[], int matrix_ld_vars[]); ! void print_handler (int v[], int im, char stats_label[][MLABEL], char table_subheader[], char table_header[]); /* All printing is sent here. */ ! void format_output (char *input, double value); /* Adjust for number of sig digits. */ ! void free_which_data (int v[]); /* Frees up the build vector/matrix. */ bool --- 18,87 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * output.c. USAGE: Go here to get stats and print. ! */ ! #include <stdio.h> /* Various types of printf. */ ! #include <stdlib.h> /* Allocation calls. */ ! #include <string.h> /* Various uses of string functions. */ ! #include <assert.h> /* The error checks. */ ! #include <math.h> /* The log function is used in desc to ! determine v length, and fpclassify. */ ! #include <float.h> /* For use of DBL_DIG. */ + #include <libmistat/labels.h> /* For Linear_Labels and Number_Linear_Labels. + */ #include "output.h" ! #include "statistics.h" /* Calls to statistical routines. */ ! #include "main.h" /* Flag variables (print_digits). */ ! #include "menu.h" /* Enumeration values, and MAX_VAR_INPUT. */ ! #include "file_ops.h" /* Sending data to the Log_File. */ ! #include "system.h" /* Bool and config.h calls; bTest flag. */ ! #include "input.h" /* For "Hit anykey". . . */ /* ! * Variables ! */ ! bool Flag_Vector; /* Vector or matrix (number of variables = 1). */ ! /* FIXME: Consider making local and passing. */ ! int Num_Vars; /* Number of variables for analysis. */ ! static int Count_Int, Count_Ld; /* Counts of respective types for making a ! matrix. */ ! int Stop_Me; /* When to stop printing. */ ! int Output_Size; /* Size of output string. */ ! long double Results[30]; /* Results of analysis. */ /* ! * Functions. ! */ ! ! /* Fill the count vectors. */ ! void build_data_list (int v[], int int_count[], int ld_count[]); ! ! /* Determine what to make (matrix/vector) and ask to make. */ ! bool setup_data (int vect_var[], int int_vars[], int ld_vars[]); ! ! /* Print descriptive tables. */ ! bool desc (bool all_stats, int v[], int matrix_int_vars[], ! int matrix_ld_vars[]); ! ! /* Regression routine. */ bool regress (int stats_to_do, int v[], int matrix_int_vars[], int matrix_ld_vars[]); ! ! /* All printing is sent here. */ ! void print_handler (int v[], int im, char *stats_label[], ! char table_subheader[], char table_header[]); ! ! /* Adjust for number of sig digits. */ ! void format_output (char *input, double value); ! ! /* Frees up the build vector/matrix. */ ! void free_which_data (int v[]); bool *************** *** 79,99 **** assert (routine >= 100 && routine <= 103); ! Flag_Vector = true; /* Default is just true because most people will just look at one variable:D */ Num_Vars = Count_Int = Count_Ld = 0; ! /* Double check to make sure we have something. */ i = 0; if (v[i] == -1) return true; ! /* Use v to fill ct_int and ct_ld. */ build_data_list (v, ct_int, ct_ld); ! /* Lets make a vector or matrix. */ verify = setup_data (v, ct_int, ct_ld); if (verify == false) return verify; ! /*Now we can go on to the analysis. */ switch (routine) { --- 93,114 ---- assert (routine >= 100 && routine <= 103); ! Flag_Vector = true; /* Default is just true because most people ! will just look at one variable:D */ Num_Vars = Count_Int = Count_Ld = 0; ! /* Double check to make sure we have something. */ i = 0; if (v[i] == -1) return true; ! /* Use v to fill ct_int and ct_ld. */ build_data_list (v, ct_int, ct_ld); ! /* Lets make a vector or matrix. */ verify = setup_data (v, ct_int, ct_ld); if (verify == false) return verify; ! /* Now we can go on to the analysis. */ switch (routine) { *************** *** 107,110 **** --- 122,126 ---- case simple_regression: + case regression_origion: verify = regress (stats_to_do, v, ct_int, ct_ld); break; *************** *** 115,119 **** } ! /* All finished so free up the matrix/vector. */ free_which_data (v); return verify; --- 131,135 ---- } ! /* All finished so free up the matrix/vector. */ free_which_data (v); return verify; *************** *** 145,149 **** } ! ct_int[Count_Int] = ct_ld[Count_Ld] = -1; /* Last value set to -1 for checks. */ } --- 161,166 ---- } ! ct_int[Count_Int] = ct_ld[Count_Ld] = -1; /* Last value set to -1 for ! checks. */ } *************** *** 154,163 **** bool verify; ! if (Num_Vars == 1) /* Vector is simple! Just up and go. */ { verify = stats_main (vect_var, true, true, Count_Int); } ! else /* Make relevant matrix/vectors. */ { Flag_Vector = false; --- 171,180 ---- bool verify; ! if (Num_Vars == 1) /* Vector is simple! Just up and go. */ { verify = stats_main (vect_var, true, true, Count_Int); } ! else /* Make relevant matrix/vectors. */ { Flag_Vector = false; *************** *** 188,223 **** int im, offset, num_int, num_ld; ! /* ! * Set up the hard table values. */ ! char stats_label[][MLABEL] = { ! {"Mean\t\t"}, ! {"SD\t\t"}, ! {"Skewness\t"}, ! {"Kurtosis\t"}, ! {"Sum\t\t"}, ! {"Min\t\t"}, ! {"Max\t\t"}, ! {"Median\t\t"}, ! {"Lower Quartile\t"}, ! {"Upper Quartile\t"}, ! {"IQR\t\t"}, ! {"ACOR\t\t"} }; char table_header[] = "\nDescriptive Statistics for"; char table_subheader[] = "Statistics\tValue\n"; ! Stop_Me = 4; /* That is, only do until Sum. */ ! /* Populate the first row with title. */ Output_Size = sizeof (table_header); num_int = num_ld = offset = 0; ! /* ! * Loop through the variables, and print output. */ for (im = 0; im <= Num_Vars - 1; im++) { ! /* Get the stats. */ ! if (Flag_Vector) /* Vector for analysis. */ { stat_test = get_mean (Flag_Vector, im, im, Results); --- 205,240 ---- int im, offset, num_int, num_ld; ! /* ! * Set up the hard table values. */ ! char *stats_label[] = { ! "Mean\t\t", ! "SD\t\t", ! "Skewness\t", ! "Kurtosis\t", ! "Sum\t\t", ! "Min\t\t", ! "Max\t\t", ! "Median\t\t", ! "Lower Quartile\t", ! "Upper Quartile\t", ! "IQR\t\t", ! "ACOR\t\t" }; char table_header[] = "\nDescriptive Statistics for"; char table_subheader[] = "Statistics\tValue\n"; ! Stop_Me = 4; /* That is, only do until Sum. */ ! /* Populate the first row with title. */ Output_Size = sizeof (table_header); num_int = num_ld = offset = 0; ! /* ! * Loop through the variables, and print output. */ for (im = 0; im <= Num_Vars - 1; im++) { ! /* Get the stats. */ ! if (Flag_Vector) /* Vector for analysis. */ { stat_test = get_mean (Flag_Vector, im, im, Results); *************** *** 245,320 **** } ! else /* We have a matrix! Off to fun land! */ { if (num_ld < Count_Ld) ! { stat_test = get_mean (Flag_Vector, matrix_ld_vars[num_ld], num_ld, Results); - if (stat_test == false) - return false; ! if (all_stats == true || bTest == true) ! { stat_test = get_sorted_stats (Flag_Vector, matrix_ld_vars[num_ld], num_ld, Results); ! ! if (stat_test == false) ! return false; ! ! Stop_Me = 10; ! } ! ! if (bTest) ! { stat_test = ! get_auto_cor (Flag_Vector, matrix_ld_vars[num_ld], ! num_ld, Results); - if (stat_test == false) - return false; ! Stop_Me = 11; ! } ! offset = matrix_ld_vars[num_ld]; ! num_ld++; } ! else if (num_int < Count_Int) { ! stat_test = ! get_mean (Flag_Vector, matrix_int_vars[num_int], num_int, ! Results); ! if (stat_test == false) ! return false; ! ! if (all_stats == true || bTest == true) ! { stat_test = ! get_sorted_stats (Flag_Vector, matrix_int_vars[num_int], ! num_int, Results); ! ! if (stat_test == false) ! return false; ! ! Stop_Me = 10; ! ! } ! ! if (bTest) ! { stat_test = get_auto_cor (Flag_Vector, matrix_int_vars[num_int], num_int, Results); ! if (stat_test == false) ! return false; ! ! Stop_Me = 11; ! } ! offset = matrix_int_vars[num_int]; num_int++; --- 262,336 ---- } ! else /* We have a matrix! Off to fun land! */ { + /* + * Start by setting ld_data to true if data is ld. + * The seriers of if/else call the correct procedure. + */ + + bool ld_data; + if (num_ld < Count_Ld) ! ld_data = true; ! else ! ld_data = false; ! ! /* Get the basic stats. */ ! if (ld_data) stat_test = get_mean (Flag_Vector, matrix_ld_vars[num_ld], num_ld, Results); + else + stat_test = + get_mean (Flag_Vector, matrix_int_vars[num_int], num_int, + Results); ! if (stat_test == false) ! return false; ! ! /* Get sorted type stats. */ ! if (all_stats == true || bTest == true) ! { ! if (ld_data) stat_test = get_sorted_stats (Flag_Vector, matrix_ld_vars[num_ld], num_ld, Results); ! else stat_test = ! get_sorted_stats (Flag_Vector, matrix_int_vars[num_int], ! num_int, Results); ! if (stat_test == false) ! return false; ! /* Set to ensure all calculated output is printed. */ ! Stop_Me = 10; } ! if (bTest) /* For accuracy testing. */ { ! if (ld_data) stat_test = ! get_auto_cor (Flag_Vector, matrix_ld_vars[num_ld], ! num_ld, Results); ! else stat_test = get_auto_cor (Flag_Vector, matrix_int_vars[num_int], num_int, Results); + if (stat_test == false) + return false; + Stop_Me = 11; + } ! /* Set offset for printing correct variable name. */ ! if (ld_data) ! { ! offset = matrix_ld_vars[num_ld]; ! num_ld++; ! } ! else ! { offset = matrix_int_vars[num_int]; num_int++; *************** *** 322,332 **** } ! /* Lets get the title in. Determine how big the variable name is! */ ! /* Pad for log, space, and \n. */ Output_Size += sizeof (table_subheader) + log (offset + 1) + 3; ! ! ! /* Print output. */ print_handler (v, im, stats_label, table_subheader, table_header); } --- 338,346 ---- } ! /* Lets get the title in. Determine how big the variable name is! */ ! /* Pad for log, space, and \n. */ ... [truncated message content] |
|
From: Mike H. B. <bik...@us...> - 2004-07-05 04:27:43
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27208 Modified Files: AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS README THANKS aclocal.m4 config.h.in configure configure.ac Log Message: Removed libtecla, now using readline. Put all file operations in file_ops.c. Finished regression work. Index: config.h.in =================================================================== RCS file: /cvsroot/mistat/mistat/config.h.in,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** config.h.in 9 Jun 2004 17:00:04 -0000 1.7 --- config.h.in 5 Jul 2004 04:26:13 -0000 1.8 *************** *** 13,18 **** #undef HAVE_LIBMISTAT ! /* Define to 1 if you have the `tecla' library (-ltecla). */ ! #undef HAVE_LIBTECLA /* Define to 1 if your system has a GNU libc compatible `malloc' function, and --- 13,18 ---- #undef HAVE_LIBMISTAT ! /* Define to 1 if you have the `readline' library (-lreadline). */ ! #undef HAVE_LIBREADLINE /* Define to 1 if your system has a GNU libc compatible `malloc' function, and Index: configure =================================================================== RCS file: /cvsroot/mistat/mistat/configure,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** configure 9 Jun 2004 17:00:04 -0000 1.13 --- configure 5 Jul 2004 04:26:13 -0000 1.14 *************** *** 312,316 **** #endif" ! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' --- 312,316 ---- #endif" ! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' *************** *** 850,855 **** --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ! --disable-dependency-tracking speeds up one-time build ! --enable-dependency-tracking do not reject slow dependency extractors Some influential environment variables: --- 850,855 ---- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ! --disable-dependency-tracking Speeds up one-time builds ! --enable-dependency-tracking Do not reject slow dependency extractors Some influential environment variables: *************** *** 1338,1342 **** ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ! am__api_version="1.8" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or --- 1338,1342 ---- ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ! am__api_version="1.7" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or *************** *** 1476,1479 **** --- 1476,1480 ---- rm conftest.sed + # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` *************** *** 1489,1517 **** fi - if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # Keeping the `.' argument allows $(mkdir_p) to be used without - # argument. Indeed, we sometimes output rules like - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. - # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more - # expensive solution, as it forces Make to start a sub-shell.) - mkdir_p='mkdir -p -- .' - else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi - fi - for ac_prog in gawk mawk nawk awk do --- 1490,1493 ---- *************** *** 1592,1596 **** rmdir .tst 2>/dev/null ! # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then --- 1568,1572 ---- rmdir .tst 2>/dev/null ! # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then *************** *** 2778,2784 **** 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 8's {/usr,}/bin/sh. ! touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf --- 2754,2758 ---- for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c ! : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf *************** *** 2981,2991 **** ! echo "$as_me:$LINENO: checking for main in -ltecla" >&5 ! echo $ECHO_N "checking for main in -ltecla... $ECHO_C" >&6 ! if test "${ac_cv_lib_tecla_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS ! LIBS="-ltecla $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ --- 2955,2965 ---- ! echo "$as_me:$LINENO: checking for main in -lreadline" >&5 ! echo $ECHO_N "checking for main in -lreadline... $ECHO_C" >&6 ! if test "${ac_cv_lib_readline_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS ! LIBS="-lreadline $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ *************** *** 3026,3035 **** echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ! ac_cv_lib_tecla_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ! ac_cv_lib_tecla_main=no fi rm -f conftest.err conftest.$ac_objext \ --- 3000,3009 ---- echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ! ac_cv_lib_readline_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ! ac_cv_lib_readline_main=no fi rm -f conftest.err conftest.$ac_objext \ *************** *** 3037,3048 **** LIBS=$ac_check_lib_save_LIBS fi ! echo "$as_me:$LINENO: result: $ac_cv_lib_tecla_main" >&5 ! echo "${ECHO_T}$ac_cv_lib_tecla_main" >&6 ! if test $ac_cv_lib_tecla_main = yes; then cat >>confdefs.h <<_ACEOF ! #define HAVE_LIBTECLA 1 _ACEOF ! LIBS="-ltecla $LIBS" fi --- 3011,3022 ---- LIBS=$ac_check_lib_save_LIBS fi ! echo "$as_me:$LINENO: result: $ac_cv_lib_readline_main" >&5 ! echo "${ECHO_T}$ac_cv_lib_readline_main" >&6 ! if test $ac_cv_lib_readline_main = yes; then cat >>confdefs.h <<_ACEOF ! #define HAVE_LIBREADLINE 1 _ACEOF ! LIBS="-lreadline $LIBS" fi *************** *** 5087,5091 **** s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t - s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t --- 5061,5064 ---- *************** *** 5736,5747 **** # Extract the definition of DEP_FILES from the Makefile without # running `make'. ! DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it ! U=`sed -n 's/^U = //p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. ! for file in `sed -n ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // --- 5709,5720 ---- # Extract the definition of DEP_FILES from the Makefile without # running `make'. ! DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it ! U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. ! for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // Index: COPYING =================================================================== RCS file: /cvsroot/mistat/mistat/COPYING,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** COPYING 30 Mar 2004 15:47:45 -0000 1.4 --- COPYING 5 Jul 2004 04:26:13 -0000 1.5 *************** *** 1,340 **** ! 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. ! ! <one line to give the program's name and a brief idea of what it does.> ! Copyright (C) <year> <name of author> ! ! 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. ! ! <signature of Ty Coon>, 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. --- 1,340 ---- ! 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. ! ! <one line to give the program's name and a brief idea of what it does.> ! Copyright (C) <year> <name of author> ! ! 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. ! ! <signature of Ty Coon>, 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. Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ChangeLog 9 Jun 2004 17:00:04 -0000 1.25 --- ChangeLog 5 Jul 2004 04:26:13 -0000 1.26 *************** *** 1,2 **** --- 1,29 ---- + 2004-07-05 Mike H. Benton (bik...@us...) + *configure.ac: Removed libtecla, added libreadline. + *src/Makefile.am: Added input.h as a source. + *src/input.h: Added. + *src/cygwin_input.c: Added. + *src/main.c: Removed libtecla references. + *src/menu.c: Removed libtecla references. + Removed do_file_menu. + Broke up do_stats_choice. + Added get_variables. + Added regression with origin. + Converted to getline. + *src/output.c: Removed libtecla references. + Added getline. + Finished regression. + Streamline of desc. + + *src/menu.h: Removed do_file_menu. + *src/file_ops.c: Added do_file_menu and include for readline. + Some housekeeping. + *src/file_ops.h: Added do_file_menu prototype. + Some housekeeping. + *src/.indent.pro: added a few more options. + + *src/system.h: Housekeeping (mostly on bool). + + 2004-06-10 Mike H. Benton (bik...@us...) *src/myformat.c: Removed. Index: Makefile.in =================================================================== RCS file: /cvsroot/mistat/mistat/Makefile.in,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile.in 9 Jun 2004 17:00:04 -0000 1.12 --- Makefile.in 5 Jul 2004 04:26:13 -0000 1.13 *************** *** 1,7 **** ! # Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ ! # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, ! # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, --- 1,7 ---- ! # Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ ! # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 ! # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, *************** *** 34,37 **** --- 34,38 ---- # Process with automake to produce Makefile.in. + srcdir = @srcdir@ top_srcdir = @top_srcdir@ *************** *** 41,44 **** --- 42,46 ---- pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ *************** *** 54,94 **** PRE_UNINSTALL = : POST_UNINSTALL = : - subdir = . - DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - THANKS config/depcomp config/install-sh config/missing \ - config/mkinstalldirs - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/configure.ac - am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) - am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno - mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs - CONFIG_HEADER = config.h - CONFIG_CLEAN_FILES = - SOURCES = - DIST_SOURCES = - RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive - ETAGS = etags - CTAGS = ctags - DIST_SUBDIRS = $(SUBDIRS) - DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - distdir = $(PACKAGE)-$(VERSION) - top_distdir = $(distdir) - am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } - DIST_ARCHIVES = $(distdir).tar.gz - GZIP_ENV = --best - distuninstallcheck_listfiles = find . -type f -print - distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ --- 56,59 ---- *************** *** 152,156 **** localstatedir = @localstatedir@ mandir = @mandir@ - mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ --- 117,120 ---- *************** *** 160,200 **** sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = src all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: ! am--refresh: ! @: ! $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) ! @for dep in $?; do \ ! case '$(am__configure_deps)' in \ ! *$$dep*) \ ! echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ ! cd $(srcdir) && $(AUTOMAKE) --gnu \ ! && exit 0; \ ! exit 1;; \ ! esac; \ ! done; \ ! echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile ! .PRECIOUS: 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__depfiles_maybe)'; \ ! cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ ! esac; ! $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck ! ! $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) ! $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) --- 124,166 ---- sysconfdir = @sysconfdir@ target_alias = @target_alias@ + SUBDIRS = src + subdir = . + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs + CONFIG_HEADER = config.h + CONFIG_CLEAN_FILES = + DIST_SOURCES = + + RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive + DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL Makefile.am NEWS THANKS aclocal.m4 \ + config.h.in config/config.guess config/config.sub \ + config/depcomp config/install-sh config/missing \ + config/mkinstalldirs configure configure.ac + DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: ! ! am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ ! configure.lineno ! $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile ! Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ! cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) ! $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck ! $(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) ! ! $(ACLOCAL_M4): configure.ac cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) *************** *** 208,215 **** @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h ! $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) ! rm -f stamp-h1 ! touch $@ distclean-hdr: --- 174,181 ---- @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h ! ! $(srcdir)/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) ! touch $(srcdir)/config.h.in distclean-hdr: *************** *** 276,279 **** --- 242,253 ---- done + ETAGS = etags + ETAGSFLAGS = + + CTAGS = ctags + CTAGSFLAGS = + + tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ *************** *** 284,288 **** END { for (i in files) print i; }'`; \ mkid -fID $$unique - tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ --- 258,261 ---- *************** *** 310,313 **** --- 283,287 ---- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique + ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ *************** *** 332,340 **** distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) ! $(mkdir_p) $(distdir)/config @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ --- 306,327 ---- distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + + top_distdir = . + distdir = $(PACKAGE)-$(VERSION) + + am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + + GZIP_ENV = --best + distuninstallcheck_listfiles = find . -type f -print + distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) ! $(mkinstalldirs) $(distdir)/config @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ *************** *** 348,352 **** if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ ! $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ --- 335,339 ---- if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ ! $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ *************** *** 365,375 **** list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ ! test -d "$(distdir)/$$subdir" \ ! || mkdir "$(distdir)/$$subdir" \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ ! top_distdir="../$(top_distdir)" \ ! distdir="../$(distdir)/$$subdir" \ distdir) \ || exit 1; \ --- 352,362 ---- list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ ! test -d $(distdir)/$$subdir \ ! || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ ! top_distdir="$(top_distdir)" \ ! distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ *************** *** 385,405 **** $(am__remove_distdir) - dist-bzip2: distdir - $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - - dist-tarZ: distdir - $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - - dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - - dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz --- 372,375 ---- *************** *** 410,425 **** # tarfile. distcheck: dist ! case '$(DIST_ARCHIVES)' in \ ! *.tar.gz*) \ ! GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\ ! *.tar.bz2*) \ ! bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\ ! *.tar.Z*) \ ! uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\ ! *.shar.gz*) \ ! GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\ ! *.zip*) \ ! unzip $(distdir).zip ;;\ ! esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build --- 380,385 ---- # tarfile. distcheck: dist ! $(am__remove_distdir) ! GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build *************** *** 441,445 **** && 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 \ --- 401,405 ---- && chmod -R a-w "$$dc_install_base" \ && ({ \ ! (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ *************** *** 448,458 **** } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ ! && $(MAKE) $(AM_MAKEFLAGS) dist \ ! && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS... [truncated message content] |
|
From: Mike H. B. <bik...@us...> - 2004-06-09 17:00:37
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30123/src Modified Files: Makefile.in cmdline.c cmdline.h error.c error.h file_ops.c file_ops.h main.c main.h menu.c menu.h mistat.ggo output.c output.h statistics.c statistics.h system.h Added Files: .indent.pro Removed Files: mystyle.c Log Message: Now with linear support. Added a test function--large sig digits (from float.h) and a few extra functions. Updated all headers. Added NIST data files to data. Index: output.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** output.h 30 May 2004 16:36:15 -0000 1.15 --- output.h 9 Jun 2004 17:00:05 -0000 1.16 *************** *** 1,34 **** ! /* functions in output.c for mistat ! ! Copyright (C) 2003, 2004 Mike H. Benton ! Mike H. Benton <bik...@us...>, 2003. ! ! 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. */ ! /*output.h*/ ! /*USAGE: Need for number of variables for analysis, or to call for output.*/ #ifndef OUTPUT_H ! #define OUTPUT_H ! #include "system.h" /* For bool and c_v variables. */ /* ! * Defines */ ! #define MCOL 60 /* Maximum columin width is 60. */ ! #define MROW 100 /* Maximum number of rows is 100. */ ! #define MLABEL 30 /* Maximum statistics label. */ /* --- 1,37 ---- ! /* Functions in output.c for mistat ! ** ! ** Copyright (C) 2003, 2004 Mike H. Benton ! ** Mike H. Benton <bik...@us...>, 2003. ! ** ! ** 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. */ ! ! /* ! * output.h USAGE: Need for number of variables for analysis, or to call for output. ! */ ! #ifndef OUTPUT_H ! # define OUTPUT_H ! # include "system.h" /* For bool and c_v variables. */ /* ! * Defines */ ! # define MCOL 60 /* Maximum columin width is 60. */ ! # define MROW 100 /* Maximum number of rows is 100. */ ! # define MLABEL 30 /* Maximum statistics label. */ /* *************** *** 36,50 **** */ ! /* output_main ! * USAGE: supply v (variables for analysis) and statistical routine. ! * RETURN: true if succesful. */ bool output_main (int v[], int routine, int stats_to_do); /* ! * Extern Data */ ! extern int Num_Vars; /*Number of variables to analyze. */ #endif ! /*Here ends output.h.*/ --- 39,53 ---- */ ! /* ! * USAGE: supply v (variables for analysis) and statistical routine. ! * RETURN: true if succesful. */ bool output_main (int v[], int routine, int stats_to_do); /* ! * Extern Data */ ! extern int Num_Vars; /* Number of variables to analyze. */ #endif ! /* Here ends output.h. */ --- NEW FILE: .indent.pro --- +blank-lines-after-procedures +brace-indent0 /*0 from 2*/ +braces-after-if-line +braces-after-struct-decl-line +break-before-boolean-operator +continuation-indentation4 /**/ +continue-at-parentheses +declaration-indentation2 +dont-cuddle-else +dont-format-comments +dont-format-first-column-comments +else-endif-column1 +ignore-newlines /**/ +indent-level4/**/ +leave-optional-blank-lines +leave-preprocessor-space /**/ +line-length80 /**/ +no-blank-lines-after-commas +no-blank-lines-after-declarations +no-tabs /**/ +preprocessor-indentation2 /**/ +procnames-start-lines +space-after-cast +space-after-procedure-calls +tab-size4 /**/ Index: file_ops.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** file_ops.h 29 May 2004 19:59:23 -0000 1.11 --- file_ops.h 9 Jun 2004 17:00:05 -0000 1.12 *************** *** 1,38 **** ! /* Header for file_ops.c in mistat. ! ! Copyright (C) 2003, 2004 Mike H. Benton ! Mike H. Benton <bik...@us...>, 2003. ! ! 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. */ ! /*file_ops.h*/ ! /*USAGE: Doing anything with a file, also when using Nrows or Columns.*/ #ifndef FILE_OPS_H ! #define FILE_OPS_H /* ! * Defines */ ! #define MAXLINE 50000 /*Current limit of max. data file lines. */ ! /*Current limit of max. data file rows (cases) ! * Based on max. number in Excel * 2 + 1. */ ! #define MAXROWS 131073 ! #define MAXCOLS 400 /*Current limit of max. data file cols (variables) */ ! /* Defines used for Data_Type. */ ! #define INT_DATA 1 ! #define FLOAT_DATA 2 ! #define CHAR_DATA 3 /* --- 1,43 ---- ! /* Header for file_ops.c in mistat. ! ** ! ** Copyright (C) 2003, 2004 Mike H. Benton ! ** Mike H. Benton <bik...@us...>, 2003. ! ** ! ** 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. */ ! ! /* ! * file_ops.h USAGE: Doing anything with a file, also when using Nrows or Columns. ! */ ! #ifndef FILE_OPS_H ! # define FILE_OPS_H /* ! * Defines */ ! # define MAXLINE 50000 /* Current limit of max. data file lines. */ ! /* ! * Current limit of max. data file rows (cases)Based on max. number in Excel * 2 + 1. ! */ ! # define MAXROWS 131073 ! # define MAXCOLS 400 /* Current limit of max. data file cols (variables). */ ! ! /* Defines used for Data_Type. */ ! # define INT_DATA 1 ! # define FLOAT_DATA 2 ! # define CHAR_DATA 3 /* *************** *** 50,63 **** /* ! * Extern data */ ! extern int Nrows; /*number of rows in data file */ ! extern int Columns; /*number of columns in a data file */ /* ! * Data_Type is an array containing the type of data for each respective variable. ! * 1 is int, 2 is float, 3 is character. */ extern int Data_Type[]; #endif ! /*Here ends file_ops.h.*/ --- 55,68 ---- /* ! * Extern data */ ! extern int Nrows; /* Number of rows in data file. */ ! extern int Columns; /* Number of columns in a data file. */ /* ! * Data_Type is an array containing the type of data for each respective variable. ! * 1 is int, 2 is float, 3 is character. */ extern int Data_Type[]; #endif ! /* Here ends file_ops.h. */ Index: mistat.ggo =================================================================== RCS file: /cvsroot/mistat/mistat/src/mistat.ggo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mistat.ggo 18 Feb 2004 05:43:04 -0000 1.2 --- mistat.ggo 9 Jun 2004 17:00:05 -0000 1.3 *************** *** 21,25 **** #Input changes below into resulting cmdline.c file. ! purpose "mistat is a statistical program based on statist.\nCopyright (C) 2003 Mike H. Benton\nmistat comes with NO WARRANTY, \nto the extent permitted by law. \nYou may redistribute copies of mistat\nunder the terms of the GNU General Public License. \nFor more information about these matters, \nsee the files named COPYING. \n" #options --- 21,25 ---- #Input changes below into resulting cmdline.c file. ! purpose "mistat is a statistical program based on statist.\nCopyright (C) 2004 Mike H. Benton\nmistat comes with NO WARRANTY, \nto the extent permitted by law. \nYou may redistribute copies of mistat\nunder the terms of the GNU General Public License. \nFor more information about these matters, \nsee the files named COPYING. \n" #options *************** *** 29,33 **** option "log" l "Write results to statist.log" flag off option "nofile" n "Do not read data file on startup.\n\t\t\tData file must be specified from menu." flag off ! #NOTE: chage cmdline.c for error check of only one file! # if (optind < argc) { --- 29,33 ---- option "log" l "Write results to statist.log" flag off option "nofile" n "Do not read data file on startup.\n\t\t\tData file must be specified from menu." flag off ! option "test" t "Suppy testing options.\n\t\tIncrease number of sig. digits." flag off #NOTE: chage cmdline.c for error check of only one file! # if (optind < argc) { Index: error.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/error.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** error.h 29 May 2004 18:22:23 -0000 1.7 --- error.h 9 Jun 2004 17:00:05 -0000 1.8 *************** *** 1,28 **** ! /*Error handling header for error.c in mistat. ! ! Copyright (C) 2003, 2004 Mike H. Benton ! Mike H. Benton <bik...@us...>, 2003. ! ! 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. */ ! /*error.h*/ ! /*USAGE: Error handling. Not much use yet.*/ #ifndef ERROR_H ! #define ERROR_H /* ! * Prototypes */ void set_signals (void); --- 1,31 ---- ! /* Error handling header for error.c in mistat. ! ** ! ** Copyright (C) 2003, 2004 Mike H. Benton ! ** Mike H. Benton <bik...@us...>, 2003. ! ** ! ** 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. */ ! ! /* ! * error.h USAGE: Error handling. Not much use yet. ! */ ! #ifndef ERROR_H ! # define ERROR_H /* ! * Prototypes */ void set_signals (void); *************** *** 33,38 **** void signal_segv (int sig_value); void signal_term (int sig_value); - /*int my_gsl_error_check (int status);*/ #endif ! /*Here ends error.h.*/ --- 36,40 ---- void signal_segv (int sig_value); void signal_term (int sig_value); #endif ! /* Here ends error.h. */ Index: file_ops.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** file_ops.c 29 May 2004 19:59:23 -0000 1.12 --- file_ops.c 9 Jun 2004 17:00:05 -0000 1.13 *************** *** 1,28 **** ! /* File operations for mistat. ! ! Copyright (C) 2003, 2004 Mike H. Benton ! Mike H. Benton <bik...@us...>, 2003. ! ! 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. */ ! /* file_ops.c */ #include <errno.h> #include <stdio.h> #include <stdlib.h> ! #include <ctype.h> /* Conversions and class testing. */ #include <string.h> --- 1,30 ---- ! /* File operations for mistat. ! ** ! ** Copyright (C) 2003, 2004 Mike H. Benton ! ** Mike H. Benton <bik...@us...>, 2003. ! ** ! ** 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. */ ! /* ! * file_ops.c USAGE: getting there. ! */ #include <errno.h> #include <stdio.h> #include <stdlib.h> ! #include <ctype.h> /* Conversions and class testing. */ #include <string.h> *************** *** 32,44 **** ! int Nrows; /*The number of rows in the data file */ ! int Columns; /*The number of Columns in the data file */ ! int Data_Type[MAXCOLS]; /* The type of data for each variable. */ void printline (FILE * fp); /* ! * Close file *file_name pointed by to *fp ! * No return */ void --- 34,46 ---- ! int Nrows; /* The number of rows in the data file. */ ! int Columns; /* The number of Columns in the data file. */ ! int Data_Type[MAXCOLS]; /* The type of data for each variable. */ void printline (FILE * fp); /* ! * Close file *file_name pointed by to *fp. ! * No return. */ void *************** *** 46,60 **** { ! if (fclose (fp) == 0) ! printf ("\t\t%s closed successfully!\n", file_name); ! else ! printf ("\t\t%s did not close\n", file_name); } /* ! * Opens file_name as a file. ! * Returns a file pointer. * FIXME: need to add type of flag input */ --- 48,62 ---- { ! if (fclose (fp) == 0) ! printf ("\t\t%s closed successfully!\n", file_name); ! else ! printf ("\t\t%s did not close\n", file_name); } /* ! * Opens file_name as a file. ! * Returns a file pointer. * FIXME: need to add type of flag input */ *************** *** 62,99 **** open_file (char *file_name, int open_mode) { ! FILE *fp; ! if (open_mode == 1) ! fp = fopen (file_name, "r"); ! else if (open_mode == 2) ! fp = fopen (file_name, "w"); ! else if (open_mode == 3) ! fp = fopen (file_name, "w+"); ! else { ! printf ("ERROR: invalid open_mode in open_file!\n"); ! exit (EXIT_FAILURE); } ! if (fp == NULL) ! fprintf (stderr, "\t\tCannot open %s!\n\t\tERROR: %s!\n", file_name, ! strerror (errno)); ! else ! printf ("\t\t%s opened successfully!\n", file_name); ! return fp; } /* ! * Returns void. ! * Counts the number of cases, and sets VARIABLE_TYPE. ! * Calls fgetline () and getwords(). * ! * FIXME: Need to set blank to missing. Need to define missing! Reads data that is not there, as above * FIXME: Reads . as a line!!!!! */ --- 64,101 ---- open_file (char *file_name, int open_mode) { ! FILE *fp; ! if (open_mode == 1) ! fp = fopen (file_name, "r"); ! else if (open_mode == 2) ! fp = fopen (file_name, "w"); ! else if (open_mode == 3) ! fp = fopen (file_name, "w+"); ! else { ! printf ("ERROR: invalid open_mode in open_file!\n"); ! exit (EXIT_FAILURE); } ! if (fp == NULL) ! fprintf (stderr, "\t\tCannot open %s!\n\t\tERROR: %s!\n", file_name, ! strerror (errno)); ! else ! printf ("\t\t%s opened successfully!\n", file_name); ! return fp; } /* ! * Returns void. ! * Counts the number of cases, and sets VARIABLE_TYPE. ! * Calls fgetline () and getwords(). * ! * FIXME: Need to set blank to missing. Need to define missing! Reads data that is not there, as above * FIXME: Reads . as a line!!!!! */ *************** *** 101,153 **** read_data_file (FILE * file_name) { ! static FILE *temp_fp; /*used for passing between read functions */ ! char line[MAXLINE]; ! char *words[MAXLINE]; ! int n; ! temp_fp = file_name; ! Nrows = 0; ! Columns = 0; ! if (file_name == NULL) { ! fprintf (stderr, ! "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", ! strerror (errno)); ! Nrows = Columns = -1; /* Set to -1 for error checks elsewhere. */ } ! else { ! while (fgetline (temp_fp, line, MAXLINE) != EOF) { ! if (Nrows >= MAXROWS) { ! fprintf (stderr, ! "ERROR: Too many rows in read_data_file. ERROR: %s\n\n", ! strerror (errno)); ! exit (EXIT_FAILURE); } ! n = getwords (line, words, MAXCOLS); ! if (Columns < n) ! Columns = n; ! Nrows++; } } ! printf ! ("\nThere are %d rows (cases)\n\tand %d Columns (variables) in the data set\n", ! Nrows, Columns); } /* ! * getwords() ! * return the number of words from fgetline() ! * replaced \0 with \t in parts */ --- 103,154 ---- read_data_file (FILE * file_name) { ! static FILE *temp_fp; /*used for passing between read functions */ ! char line[MAXLINE]; ! char *words[MAXLINE]; ! int n; ! temp_fp = file_name; ! Nrows = 0; ! Columns = 0; ! if (file_name == NULL) { ! fprintf (stderr, ! "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", ! strerror (errno)); ! Nrows = Columns = -1; /* Set to -1 for error checks elsewhere. */ } ! else { ! while (fgetline (temp_fp, line, MAXLINE) != EOF) { ! if (Nrows >= MAXROWS) { ! fprintf (stderr, ! "ERROR: Too many rows in read_data_file. ERROR: %s\n\n", ! strerror (errno)); ! exit (EXIT_FAILURE); } ! n = getwords (line, words, MAXCOLS); ! if (Columns < n) ! Columns = n; ! Nrows++; } } ! printf ! ("\nThere are %d rows (cases)\n\tand %d Columns (variables) in the data set\n", ! Nrows, Columns); } /* ! * Return the number of words from fgetline(). ! * Replaced \0 with \t in parts. */ *************** *** 156,244 **** { ! bool is_int, is_float, is_char; ! char *p = line; ! int nwords, testing, location; ! nwords = 0; ! /* Infinite. Break within. */ ! while (1) { ! /* Set to false for first run of word. */ ! is_int = is_float = is_char = false; ! /* If a space, go until not. */ ! while (isspace (*p)) ! p++; ! /* If end of line, go home with results. */ ! if (*p == '\0') ! return nwords; ! location = nwords; ! words[nwords++] = p; ! /* ! * Cycle through until end or separator. ! * Test to determine type of data. ! */ ! while (!isspace (*p) && *p != '\0') { ! testing = isdigit (*p); ! if (is_int == true && *p == '.' && is_float == false) { ! is_float = true; ! is_int = false; } ! else if (is_float == false && is_int == false && is_char == false ! && testing != 0) { ! is_int = true; } ! else if (is_float == false && is_char == false && *p == '.') ! is_float = true; ! else if (testing == 0) { ! is_char = true; ! is_int = false; ! is_float = false; } ! p++; } ! /* Set the Data_Type. */ ! if (is_float == true && Data_Type[location] != CHAR_DATA) { ! Data_Type[location] = FLOAT_DATA; } ! if (is_int == true ! && (Data_Type[location] != CHAR_DATA ! || Data_Type[location] != FLOAT_DATA)) { ! Data_Type[location] = INT_DATA; } ! if (is_char == true) { ! Data_Type[location] = CHAR_DATA; } ! /* If end, go back. */ ! if (*p == '\0') ! return nwords; ! /* Need and error here. */ ! if (nwords >= maxwords) ! return nwords; ! /*We need to go back look at next word. */ ! p++; } --- 157,245 ---- { ! bool is_int, is_float, is_char; ! char *p = line; ! int nwords, testing, location; ! nwords = 0; ! /* Infinite. Break within. */ ! while (1) { ! /* Set to false for first run of word. */ ! is_int = is_float = is_char = false; ! /* If a space, go until not. */ ! while (isspace (*p)) ! p++; ! /* If end of line, go home with results. */ ! if (*p == '\0') ! return nwords; ! location = nwords; ! words[nwords++] = p; ! /* ! * Cycle through until end or separator. ! * Test to determine type of data. ! */ ! while (!isspace (*p) && *p != '\0') { ! testing = isdigit (*p); ! if (is_int == true && *p == '.' && is_float == false) { ! is_float = true; ! is_int = false; } ! else if (is_float == false && is_int == false && is_char == false ! && testing != 0) { ! is_int = true; } ! else if (is_float == false && is_char == false && *p == '.') ! is_float = true; ! else if (testing == 0) { ! is_char = true; ! is_int = false; ! is_float = false; } ! p++; } ! /* Set the Data_Type. */ ! if (is_float == true && Data_Type[location] != CHAR_DATA) { ! Data_Type[location] = FLOAT_DATA; } ! if (is_int == true ! && (Data_Type[location] != CHAR_DATA ! || Data_Type[location] != FLOAT_DATA)) { ! Data_Type[location] = INT_DATA; } ! if (is_char == true) { ! Data_Type[location] = CHAR_DATA; } ! /* If end, go back. */ ! if (*p == '\0') ! return nwords; ! /* Need and error here. */ ! if (nwords >= maxwords) ! return nwords; ! /* We need to go back look at next word. */ ! p++; } *************** *** 247,255 **** /* ! * fgetline() ! * Gets a line of data from a file. ! * Return EOF if end of file or number of characters. ! * Writes values of line to line[] array. ! * max is maximum line length. */ --- 248,255 ---- /* ! * Gets a line of data from a file. ! * Return EOF if end of file or number of characters. ! * Writes values of line to line[] array. ! * max is maximum line length. */ *************** *** 257,289 **** fgetline (FILE * fp, char line[], int max) { ! int nch = 0; ! int c; ! max = max - 1; ! while ((c = getc (fp)) != EOF) { ! if (c == '\n') ! break; ! if (nch < max) { ! line[nch] = c; ! nch = nch + 1; } } ! if (c == EOF && nch == 0) ! return EOF; ! line[nch] = '\0'; ! return nch; } /* ! * Just shows the log file. ! * Very sloppy for the moment. ! * Need to be more interactive (up/down/copy). */ --- 257,289 ---- fgetline (FILE * fp, char line[], int max) { ! int nch = 0; ! int c; ! max = max - 1; ! while ((c = getc (fp)) != EOF) { ! if (c == '\n') ! break; ! if (nch < max) { ! line[nch] = c; ! nch = nch + 1; } } ! if (c == EOF && nch == 0) ! return EOF; ! line[nch] = '\0'; ! return nch; } /* ! * Just shows the log file. ! * Very sloppy for the moment. ! * Need to be more interactive (up/down/copy). */ *************** *** 292,303 **** { ! rewind (Log_File); ! printf ("LOGFILE\n\n"); ! printline (Log_File); } /* ! * Currently print a file. */ --- 292,303 ---- { ! rewind (Log_File); ! printf ("LOGFILE\n\n"); ! printline (Log_File); } /* ! * Currently print a file. */ *************** *** 305,317 **** printline (FILE * fp) { ! char s[MAXLINE]; ! while ((fgets (s, MAXLINE, fp)) != NULL) ! printf ("%s", s); } /* ! * Update the log file. */ --- 305,317 ---- printline (FILE * fp) { ! char s[MAXLINE]; ! while ((fgets (s, MAXLINE, fp)) != NULL) ! printf ("%s", s); } /* ! * Update the log file. */ *************** *** 319,341 **** update_logfile (char *message) { ! if (Log_File_Flag) { ! if ((fprintf (Log_File, "\n\n")) < 0) { ! fprintf (stderr, ! "\n\nERROR: not printing to log file.\nERROR: %s\n\n", ! strerror (errno)); ! exit (EXIT_FAILURE); } ! fprintf (Log_File, "%s", message); ! /*Only need for Cygwin */ ! /*Seems to do no harm in Linux */ ! if ((fflush (Log_File)) == EOF) { ! printf ("Unable to flush the logfile!\n"); ! exit (EXIT_FAILURE); } } --- 319,341 ---- update_logfile (char *message) { ! if (Log_File_Flag) { ! if ((fprintf (Log_File, "\n\n")) < 0) { ! fprintf (stderr, ! "\n\nERROR: not printing to log file.\nERROR: %s\n\n", ! strerror (errno)); ! exit (EXIT_FAILURE); } ! fprintf (Log_File, "%s", message); ! /* Only need for Cygwin */ ! /* Seems to do no harm in Linux */ ! if ((fflush (Log_File)) == EOF) { ! printf ("Unable to flush the logfile!\n"); ! exit (EXIT_FAILURE); } } *************** *** 343,349 **** /* ! * Use to read only certain Columns. ! * Fills t[]. Element is column of data set. ! * Returns to be worked out */ --- 343,349 ---- /* ! * Use to read only certain Columns. ! * Fills t[]. Element is column of data set. ! * Returns to be worked out */ *************** *** 351,397 **** getit (FILE * file_name, int element, long double t[]) { ! static FILE *temp_fp; /*used for passing between read functions */ ! char line[MAXLINE]; ! char *words[MAXLINE]; ! int n; ! int i; ! temp_fp = file_name; ! i = 0; ! if (file_name == NULL) { ! fprintf (stderr, ! "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", ! strerror (errno)); ! exit (EXIT_FAILURE); } ! else { ! rewind (Data_File); ! while (fgetline (temp_fp, line, MAXLINE) != EOF) { ! if (i >= MAXROWS) { ! fprintf (stderr, ! "ERROR: Too many rows (%d, max %d) in getit. ERROR: %s\n\n", ! i, MAXROWS, strerror (errno)); ! exit (EXIT_FAILURE); } ! n = getwords (line, words, MAXCOLS); ! t[i] = atof (words[element]); ! i++; } } ! return 1; } --- 351,399 ---- getit (FILE * file_name, int element, long double t[]) { ! static FILE *temp_fp; /* Used for passing between read functions. */ ! char line[MAXLINE]; ! char *words[MAXLINE]; ! int n; ! int i; ! temp_fp = file_name; ! i = 0; ! if (file_name == NULL) { ! fprintf (stderr, ! "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", ! strerror (errno)); ! exit (EXIT_FAILURE); } ! else { ! rewind (Data_File); ! while (fgetline (temp_fp, line, MAXLINE) != EOF) { ! if (i >= MAXROWS) { ! fprintf (stderr, ! "ERROR: Too many rows (%d, max %d) in getit. ERROR: %s\n\n", ! i, MAXROWS, strerror (errno)); ! exit (EXIT_FAILURE); } ! n = getwords (line, words, MAXCOLS); ! t[i] = atof (words[element]); ! i++; } } ! return 1; } + + /* Here ends file_ops.c. */ Index: error.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/error.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** error.c 29 May 2004 19:59:23 -0000 1.10 --- error.c 9 Jun 2004 17:00:05 -0000 1.11 *************** *** 1,22 **** ! /* Error handling for mistat. ! ! Copyright (C) 2003, 2004 Mike H. Benton ! Mike H. Benton <bik...@us...>, 2003. ! ! 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. */ - /*error.c*/ #include <stdio.h> --- 1,25 ---- ! /* Error handling for mistat. ! ** ! ** Copyright (C) 2003, 2004 Mike H. Benton ! ** Mike H. Benton <bik...@us...>, 2003. ! ** ! ** 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. ! */ ! /* ! * error.c USAGE: Not sure yet. */ #include <stdio.h> *************** *** 28,33 **** /* ! * Called by main.c. ! * Sets up for error's to go here. */ --- 31,36 ---- /* ! * Called by main.c. ! * Sets up for error's to go here. */ *************** *** 35,57 **** set_signals (void) { ! signal (SIGABRT, signal_abrt); ! signal (SIGFPE, signal_fpe); ! signal (SIGILL, signal_ill); ! signal (SIGINT, signal_int); ! signal (SIGSEGV, signal_segv); ! signal (SIGTERM, signal_term); } ! /*The next six are the error handlers.*/ void signal_abrt (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGABRT: From abort!%d\n", sig_value); ! exit (EXIT_FAILURE); } --- 38,60 ---- set_signals (void) { ! signal (SIGABRT, signal_abrt); ! signal (SIGFPE, signal_fpe); ! signal (SIGILL, signal_ill); ! signal (SIGINT, signal_int); ! signal (SIGSEGV, signal_segv); ! signal (SIGTERM, signal_term); } ! /* The next six are the error handlers. */ void signal_abrt (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGABRT: From abort!%d\n", sig_value); ! exit (EXIT_FAILURE); } *************** *** 59,68 **** signal_fpe (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGFPE: Math error: divide by 0 or overflow! Value: ->%d<-.\n", ! sig_value); ! exit (EXIT_FAILURE); } --- 62,71 ---- signal_fpe (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGFPE: Math error: divide by 0 or overflow! Value: ->%d<-.\n", ! sig_value); ! exit (EXIT_FAILURE); } *************** *** 70,78 **** signal_ill (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGILL: Illegal instruction! %d\n", sig_value); ! exit (EXIT_FAILURE); } --- 73,81 ---- signal_ill (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGILL: Illegal instruction! %d\n", sig_value); ! exit (EXIT_FAILURE); } *************** *** 80,88 **** signal_int (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGINT: Interrupt! A ctrl-c!%d\n", sig_value); ! exit (EXIT_FAILURE); } --- 83,91 ---- signal_int (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGINT: Interrupt! A ctrl-c!%d\n", sig_value); ! exit (EXIT_FAILURE); } *************** *** 90,98 **** signal_segv (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGSEGV: invalid access to storage! Value: ->%d<-.\n", sig_value); ! exit (EXIT_FAILURE); } --- 93,101 ---- signal_segv (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGSEGV: invalid access to storage! Value: ->%d<-.\n", sig_value); ! exit (EXIT_FAILURE); } *************** *** 100,108 **** signal_term (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGTERM: Termination request sent!%d\n", sig_value); ! exit (EXIT_FAILURE); } --- 103,111 ---- signal_term (int sig_value) { ! printf ("\n\n"); ! if (Bell) ! printf ("\a"); ! printf ("SIGTERM: Termination request sent!%d\n", sig_value); ! exit (EXIT_FAILURE); } Index: system.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/system.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** system.h 29 May 2004 19:59:23 -0000 1.6 --- system.h 9 Jun 2004 17:00:05 -0000 1.7 *************** *** 1,56 **** ! /* Shared definitions for mistat. ! ! Copyright (C) 2003, 2004 Mike H. Benton ! Mike H. Benton <bik...@us...>, 2003. ! ! 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. */ - /*system.h*/ - /*USAGE: bool, flags, and MLINE.*/ #ifndef SYSTEM_H ! #define SYSTEM_H ! /*If using autoconf.*/ ! #ifdef HAVE_CONFIG_H ! #include "config.h" ! #endif ! /*Bring in bool.*/ ! #if HAVE_STDBOOL_H ! # include <stdbool.h> ! #else ! # define bool _Bool ! # define false 0 ! # define true 1 ! # define __bool_true_false_are_defined 1 ! #endif ! #include "memwatch.h" /* ! * Defines */ ! #define MLINE 255 /*Maximum input line length */ /* ! * Variables */ ! bool Bell; /*Determine to see if sound system bell */ bool Log_File_Flag; extern bool Data_File_Exist; #endif ! /*Here ends system.h.*/ --- 1,59 ---- ! /* Shared definitions for mistat. ! ** ! ** Copyright (C) 2003, 2004 Mike H. Benton ! ** Mike H. Benton <bik...@us...>, 2003. ! ** ! ** 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. ! */ ! ! /* ! * system.h USAGE: bool, flags, and MLINE. */ #ifndef SYSTEM_H ! # define SYSTEM_H ! /* If using autoconf. */ ! # ifdef HAVE_CONFIG_H ! # include "config.h" ! # endif ! /* Bring in bool. */ ! # if HAVE_STDBOOL_H ! # include <stdbool.h> ! # else ! # define bool _Bool ! # define false 0 ! # define true 1 ! # define __bool_true_false_are_defined 1 ! # endif ! # include "memwatch.h" /* ! * Defines */ ! # define MLINE 255 /* Maximum input line length. */ /* ! * Variables */ ! bool Bell; /* Determine to see if sound system bell. */ bool Log_File_Flag; + bool bTest; /* Test mode enabled. */ extern bool Data_File_Exist; #endif ! /* Here ends system.h. */ Index: cmdline.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/cmdline.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cmdline.c 29 May 2004 18:22:23 -0000 1.8 --- cmdline.c 9 Jun 2004 17:00:05 -0000 1.9 *************** *** 6,15 **** The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: ! we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H ! #include "config.h" #endif --- 6,15 ---- The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: ! we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H ! # include "config.h" #endif *************** *** 25,33 **** static void clear_args (struct gengetopt_args_info *args_info); ! static int ! cmdline_parser_internal (int argc, char *const *argv, ! struct gengetopt_args_info *args_info, int override, ! int initialize, int check_required, ! const char *additional_error); static char *gengetopt_strdup (const char *s); --- 25,33 ---- static void clear_args (struct gengetopt_args_info *args_info); ! static int cmdline_parser_internal (int argc, char *const *argv, ! struct gengetopt_args_info *args_info, ! int override, int initialize, ! int check_required, ! const char *additional_error); static char *gengetopt_strdup (const char *s); *************** *** 36,45 **** clear_given (struct gengetopt_args_info *args_info) { ! args_info->help_given = 0; ! args_info->version_given = 0; ! args_info->nobell_given = 0; ! args_info->digits_given = 0; ! args_info->log_given = 0; ! args_info->nofile_given = 0; } --- 36,46 ---- clear_given (struct gengetopt_args_info *args_info) { ! args_info->help_given = 0; ! args_info->version_given = 0; ! args_info->nobell_given = 0; ! args_info->digits_given = 0; ! args_info->log_given = 0; ! args_info->nofile_given = 0; ! args_info->test_given = 0; } *************** *** 47,54 **** clear_args (struct gengetopt_args_info *args_info) { ! args_info->nobell_flag = 0; ! args_info->digits_arg = 2; ! args_info->log_flag = 0; ! args_info->nofile_flag = 0; } --- 48,56 ---- clear_args (struct gengetopt_args_info *args_info) { ! args_info->nobell_flag = 0; ! args_info->digits_arg = 2; ! args_info->log_flag = 0; ! args_info->nofile_flag = 0; ! args_info->test_flag = 0; } *************** *** 56,60 **** cmdline_parser_print_version (void) { ! printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); } --- 58,62 ---- cmdline_parser_print_version (void) { ! printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION); } *************** *** 62,81 **** cmdline_parser_print_help (void) { ! cmdline_parser_print_version (); ! printf ("\n" ! "Purpose:\n" ! " mistat is a statistical program based on statist.\nCopyright (C) 2003 Mike H. Benton\nmistat comes with NO WARRANTY, \nto the extent permitted by law. \nYou may redistribute copies of mistat\nunder the terms of the GNU General Public License. \nFor more information about these matters, \nsee the files named COPYING. \n\n" ! "\n" "Usage: %s [OPTIONS]... [FILES]...\n", CMDLINE_PARSER_PACKAGE); ! printf ("\n"); ! printf ("%s\n", " -h, --help Print help and exit"); ! printf ("%s\n", " -V, --version Print version and exit"); ! printf ("%s\n", ! " -b, --nobell No beeps on errors or warnings (default=off)"); ! printf ("%s\n", ! " -d, --digits=INT Number of digits to print (default=`2')"); ! printf ("%s\n", ! " -l, --log Write results to statist.log (default=off)"); ! printf ("%s\n", ! " -n, --nofile Do not read data file on startup.\n\t\t\tData file must be specified from menu. (default=off)\n"); } --- 64,84 ---- cmdline_parser_print_help (void) { ! cmdline_parser_print_version (); ! printf ("\n" "Purpose:\n" ! " mistat is a statistical program based on statist.\nCopyright (C) 2004 Mike H. Benton\nmistat comes with NO WARRANTY, \nto the extent permitted by law. \nYou may redistribute copies of mistat\nunder the terms of the GNU General Public License. \nFor more information about these matters, \nsee the files named COPYING. \n\n" ! "\n" "Usage: %s [OPTIONS]... [FILES]...\n", CMDLINE_PARSER_PACKAGE); ! printf ("\n"); ! printf ("%s\n", " -h, --help Print help and exit"); ! printf ("%s\n", " -V, --version Print version and exit"); ! printf ("%s\n", ! " -b, --nobell No beeps on errors or warnings (default=off)"); ! printf ("%s\n", ! " -d, --digits=INT Number of digits to print (default=`2')"); ! printf ("%s\n", ! " -l, --log Write results to statist.log (default=off)"); ! printf ("%s\n", ! " -n, --nofile Do not read data file on startup.\n\t\t\tData file must be specified from menu. (default=off)\n"); ! printf ("%s\n", ! " -t, --test Suppy testing options.\n \t\tIncrease number of sig. digits. (default=off)"); } *************** *** 83,91 **** cmdline_parser_init (struct gengetopt_args_info *args_info) { ! clear_given (args_info); ! clear_args (args_info); ! args_info->inputs = NULL; ! args_info->inputs_num = 0; } --- 86,94 ---- cmdline_parser_init (struct gengetopt_args_info *args_info) { ! clear_given (args_info); ! clear_args (args_info); ! args_info->inputs = NULL; ! args_info->inputs_num = 0; } *************** *** 94,106 **** { ! unsigned i; ! for (i = 0; i < args_info->inputs_num; ++i) ! free (args_info->inputs[i]); ! if (args_info->inputs_num) ! free (args_info->inputs); ! clear_given (args_info); } --- 97,109 ---- { ! unsigned i; ! for (i = 0; i < args_info->inputs_num; ++i) ! free (args_info->inputs[i]); ! if (args_info->inputs_num) ! free (args_info->inputs); ! clear_given (args_info); } *************** *** 111,123 **** gengetopt_strdup (const char *s) { ! char *result = NULL; ! if (!s) ! return result; ! result = (char *) malloc (strlen (s) + 1); ! if (result == (char *) 0) ! return (char *) 0; ! strcpy (result, s); ! return result; } --- 114,126 ---- gengetopt_strdup (const char *s) { ! char *result = NULL; ! if (!s) ! return result; ! result = (char *) malloc (strlen (s) + 1); ! if (result == (char *) 0) ! return (char *) 0; ! strcpy (result, s); ! return result; } *************** *** 126,130 **** struct gengetopt_args_info *args_info) { ! return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } --- 129,133 ---- struct gengetopt_args_info *args_info) { ! return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } *************** *** 134,150 **** int initialize, int check_required) { ! int result; ! result = ! cmdline_parser_internal (argc, argv, args_info, override, initialize, ! check_required, NULL); ! if (result == EXIT_FAILURE) { ! cmdline_parser_free (args_info); ! exit (EXIT_FAILURE); } ! return result; } --- 137,153 ---- int initialize, int check_required) { ! int result; ! result = ! cmdline_parser_internal (argc, argv, args_info, override, initialize, ! check_required, NULL); ! if (result == EXIT_FAILURE) { ! cmdline_parser_free (args_info); ! exit (EXIT_FAILURE); } ! return result; } *************** *** 155,181 **** const char *additional_error) { ! int c; /* Character of the parsed option. */ ! int error = 0; ! struct gengetopt_args_info local_args_info; ! if (initialize) ! cmdline_parser_init (args_info); ! cmdline_parser_init (&local_args_info); ! optarg = 0; ! optind = 1; ! opterr = 1; ! optopt = '?'; ! while (1) { ! int option_index = 0; ! char *stop_char; ! static struct option long_options[] = ! { ! {"help", 0, NULL, 'h' ! }, {"version", 0, NULL, 'V'}, {"nobell", 0, NULL, 'b'}, --- 158,182 ---- const char *additional_error) { ! int c; /* Character of the parsed option. */ ! int error = 0; ! struct gengetopt_args_info local_args_info; ! if (initialize) ! cmdline_parser_init (args_info); ! cmdline_parser_init (&local_args_info); ! optarg = 0; ! optind = 1; ! opterr = 1; ! optopt = '?'; ! while (1) { ! int option_index = 0; ! char *stop_char; ! static struct option long_options[] = { ! {"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {"nobell", 0, NULL, 'b'}, *************** *** 183,317 **** {"log", 0, NULL, 'l'}, {"nofile", 0, NULL, 'n'}, {NULL, 0, NULL, 0} ! }; ! stop_char = 0; ! c = getopt_long (argc, argv, "hVbd:ln", long_options, &option_index); ! if (c == -1) ! break; /* Exit from `while (1)' loop. */ ! switch (c) { ! case 'h': /* Print help and exit. */ ! cmdline_parser_print_help (); ! exit (EXIT_SUCCESS); ! case 'V': /* Print version and exit. */ ! cmdline_parser_print_version (); ! exit (EXIT_SUCCESS); ! case 'b': /* No beeps on errors or warnings. */ ! if (local_args_info.nobell_given) { ! fprintf (stderr, ! "%s: `--nobell' (`-b') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } ! if (args_info->nobell_given && !override) ! continue; ! local_args_info.nobell_given = 1; ! args_info->nobell_given = 1; ! args_info->nobell_flag = !(args_info->nobell_flag); ! break; ! case 'd': /* Number of digits to print. */ ! if (local_args_info.digits_given) { ! fprintf (stderr, ! "%s: `--digits' (`-d') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } ! if (args_info->digits_given && !override) ! continue; ! local_args_info.digits_given = 1; ! args_info->digits_given = 1; ! args_info->digits_arg = strtol (optarg, &stop_char, 0); ! break; ! case 'l': /* Write results to statist.log. */ ! if (local_args_info.log_given) { ! fprintf (stderr, ! "%s: `--log' (`-l') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } ! if (args_info->log_given && !override) ! continue; ! local_args_info.log_given = 1; ! args_info->log_given = 1; ! args_info->log_flag = !(args_info->log_flag); ! break; ! case 'n': /* Do not read data file on startup.\n\t\t\tData file must be specified from menu.. */ ! if (local_args_info.nofile_given) { ! fprintf (stderr, ! "%s: `--nofile' (`-n') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } ! if (args_info->nofile_given && !override) ! continue; ! local_args_info.nofile_given = 1; ! args_info->nofile_given = 1; ! args_info->nofile_flag = !(args_info->nofile_flag); ! break; - case 0: /* Long option with no short option */ ! case '?': /* Invalid option. */ ! /* `getopt_long' already printed an error message. */ ! goto failure; ! default: /* bug: option not considered. */ ! fprintf (stderr, "%s: option unknown: %c%s\n", ! CMDLINE_PARSER_PACKAGE, c, ! (additional_error ? additional_error : "")); ! abort (); ! } /* switch */ ! } /* while */ ! if (check_required) ! {} ! if (error) ! return (EXIT_FAILURE); ! if (optind < argc) { ! if ((argc - optind) == 1) { ! int i = 0; ! args_info->inputs_num = argc - optind; ! args_info->inputs = ! (char **) (malloc ((args_info->inputs_num) * sizeof (char *))); ! while (optind < argc) ! args_info->inputs[i++] = gengetopt_strdup (argv[optind++]); } ! else { ! printf ("Only one file can be used for input! Exiting.\n\n"); ! exit (EXIT_FAILURE); } } ! return 0; ! failure: ! cmdline_parser_free (&local_args_info); ! return (EXIT_FAILURE); } --- 184,336 ---- {"log", 0, NULL, 'l'}, {"nofile", 0, NULL, 'n'}, + {"test", 0, NULL, 't'}, {NULL, 0, NULL, 0} ! }; ! stop_char = 0; ! c = getopt_long (argc, argv, "hVbd:lnt", long_options, &option_index); ! if (c == -1) ! break; /* Exit from `while (1)' loop. */ ! switch (c) { ! case 'h': /* Print help and exit. */ ! cmdline_parser_print_help (); ! exit (EXIT_SUCCESS); ! case 'V': /* Print version and exit. */ ! cmdline_parser_print_version (); ! exit (EXIT_SUCCESS); ! case 'b': /* No beeps on errors or warnings. */ ! if (local_args_info.nobell_given) { ! fprintf (stderr, ! "%s: `--nobell' (`-b') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } ! if (args_info->nobell_given && !override) ! continue; ! local_args_info.nobell_given = 1; ! args_info->nobell_given = 1; ! args_info->nobell_flag = !(args_info->nobell_flag); ! break; ! case 'd': /* Number of digits to print. */ ! if (local_args_info.digits_given) { ! fprintf (stderr, ! "%s: `--digits' (`-d') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } ! if (args_info->digits_given && !override) ! continue; ! local_args_info.digits_given = 1; ! args_info->digits_given = 1; ! args_info->digits_arg = strtol (optarg, &stop_char, 0); ! break; ! case 'l': /* Write results to statist.log. */ ! if (local_args_info.log_given) { ! fprintf (stderr, ! "%s: `--log' (`-l') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } ! if (args_info->log_given && !override) ! continue; ! local_args_info.log_given = 1; ! args_info->log_given = 1; ! args_info->log_flag = !(args_info->log_flag); ! break; ! case 'n': /* Do not read data file on startup.\n\t\t\tData file must be specified from menu.. */ ! if (local_args_info.nofile_given) { ! fprintf (stderr, ! "%s: `--nofile' (`-n') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } ! if (args_info->nofile_given && !override) ! continue; ! local_args_info.nofile_given = 1; ! args_info->nofile_given = 1; ! args_info->nofile_flag = !(args_info->nofile_flag); ! break; + case 't': /* Suppy testing options.\n\t\tIncrease number of sig. digits.. */ + if (local_args_info.test_given) + { + fprintf (stderr, + "%s: `--test' (`-t') option given more than once%s\n", + CMDLINE_PARSER_PACKAGE, + (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->test_given && !override) + continue; + local_args_info.test_given = 1; + args_info->test_given = 1; + args_info->test_flag = !(args_info->test_flag); + break; ! case 0: /* Long option with no short option */ ! case '?': /* Invalid option. */ ! /* `getopt_long' already printed an error message. */ ! goto failu... [truncated message content] |
|
From: Mike H. B. <bik...@us...> - 2004-06-09 17:00:20
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30123 Modified Files: ChangeLog Makefile.in aclocal.m4 config.h.in configure configure.ac Log Message: Now with linear support. Added a test function--large sig digits (from float.h) and a few extra functions. Updated all headers. Added NIST data files to data. Index: Makefile.in =================================================================== RCS file: /cvsroot/mistat/mistat/Makefile.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.in 25 Apr 2004 22:30:43 -0000 1.11 --- Makefile.in 9 Jun 2004 17:00:04 -0000 1.12 *************** *** 1,7 **** ! # Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ ! # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 ! # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, --- 1,7 ---- ! # Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ ! # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, ! # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, *************** *** 59,63 **** $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ THANKS config/depcomp config/install-sh config/missing \ ! config/mkinstalldirs configure configure.ac ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac --- 59,63 ---- $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ THANKS config/depcomp config/install-sh config/missing \ ! config/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac *************** *** 65,69 **** $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ ! configure.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h --- 65,69 ---- $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ ! configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h *************** *** 152,155 **** --- 152,156 ---- localstatedir = @localstatedir@ mandir = @mandir@ + mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ *************** *** 440,444 **** && chmod -R a-w "$$dc_install_base" \ && ({ \ ! (cd ../.. && $(mkdir_p) "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ --- 441,445 ---- && 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 \ Index: configure.ac =================================================================== RCS file: /cvsroot/mistat/mistat/configure.ac,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** configure.ac 30 Mar 2004 15:47:45 -0000 1.9 --- configure.ac 9 Jun 2004 17:00:04 -0000 1.10 *************** *** 36,40 **** # Checks for header files. AC_HEADER_STDC ! AC_CHECK_HEADERS([stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. --- 36,40 ---- # Checks for header files. AC_HEADER_STDC ! AC_CHECK_HEADERS([float.h stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. Index: config.h.in =================================================================== RCS file: /cvsroot/mistat/mistat/config.h.in,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** config.h.in 30 Mar 2004 15:47:45 -0000 1.6 --- config.h.in 9 Jun 2004 17:00:04 -0000 1.7 *************** *** 1,4 **** --- 1,7 ---- /* config.h.in. Generated from configure.ac by autoheader. */ + /* Define to 1 if you have the <float.h> header file. */ + #undef HAVE_FLOAT_H + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H Index: configure =================================================================== RCS file: /cvsroot/mistat/mistat/configure,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** configure 30 Mar 2004 15:47:45 -0000 1.12 --- configure 9 Jun 2004 17:00:04 -0000 1.13 *************** *** 312,316 **** #endif" ! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' --- 312,316 ---- #endif" ! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' *************** *** 850,855 **** --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ! --disable-dependency-tracking Speeds up one-time builds ! --enable-dependency-tracking Do not reject slow dependency extractors Some influential environment variables: --- 850,855 ---- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ! --disable-dependency-tracking speeds up one-time build ! --enable-dependency-tracking do not reject slow dependency extractors Some influential environment variables: *************** *** 1338,1342 **** ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ! am__api_version="1.7" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or --- 1338,1342 ---- ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ! am__api_version="1.8" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or *************** *** 1476,1480 **** rm conftest.sed - # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` --- 1476,1479 ---- *************** *** 1490,1493 **** --- 1489,1517 ---- fi + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi + fi + for ac_prog in gawk mawk nawk awk do *************** *** 1568,1572 **** rmdir .tst 2>/dev/null ! # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then --- 1592,1596 ---- rmdir .tst 2>/dev/null ! # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then *************** *** 2754,2758 **** for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c ! : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf --- 2778,2784 ---- 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 8's {/usr,}/bin/sh. ! touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf *************** *** 3514,3518 **** ! for ac_header in stdlib.h string.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --- 3540,3545 ---- ! ! for ac_header in float.h stdlib.h string.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` *************** *** 5060,5063 **** --- 5087,5091 ---- s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t + s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t *************** *** 5708,5719 **** # Extract the definition of DEP_FILES from the Makefile without # running `make'. ! DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it ! U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. ! for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // --- 5736,5747 ---- # Extract the definition of DEP_FILES from the Makefile without # running `make'. ! DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it ! U=`sed -n 's/^U = //p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. ! for file in `sed -n ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ChangeLog 30 May 2004 16:36:15 -0000 1.24 --- ChangeLog 9 Jun 2004 17:00:04 -0000 1.25 *************** *** 1,2 **** --- 1,20 ---- + 2004-06-10 Mike H. Benton (bik...@us...) + *src/myformat.c: Removed. + *src/.indent.pro: Used on all source files (indent). Also, + updated file headers to keep consistant! + + *src/mistat.ggo: Added test options and housekeeping. + *src/cmdline.c: Added test options (lag function and output style.). + *src/cmdline.h: Changes from above. + *src/main.c (do_args): Changes from above. + *src/system.h: Added test flag. + *configure.ac: Added float.h, used in output.c. + + *src/output.c: Changes for test option and continued work. Simple regression + is in. + *src/statistics.c: Added regression and lag functions. + *src/statistics.h: Support regression and lag functions. + + 2004-05-31 Mike H. Benton (bik...@us...) *src/statistics.c (stats_main): Change in the use of verify--message printed here. Index: aclocal.m4 =================================================================== RCS file: /cvsroot/mistat/mistat/aclocal.m4,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** aclocal.m4 30 Mar 2004 15:47:45 -0000 1.7 --- aclocal.m4 9 Jun 2004 17:00:04 -0000 1.8 *************** *** 1,5 **** ! # generated automatically by aclocal 1.7.9 -*- Autoconf -*- ! # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation --- 1,5 ---- ! # generated automatically by aclocal 1.8.3 -*- Autoconf -*- ! # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. [...1011 lines suppressed...] ! # 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="\${SHELL} \$(install_sh) -c -s" ! AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
|
From: Mike H. B. <bik...@us...> - 2004-06-09 17:00:19
|
Update of /cvsroot/mistat/mistat/Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30123/Data Added Files: Lew.dat Lottery.dat Mavro.dat Michelso.dat NoInt1.dat NoInt2.dat Norris.dat NumAcc1.dat NumAcc2.dat NumAcc3.dat NumAcc4.dat Removed Files: data.dat data2.dat datafile.dat Log Message: Now with linear support. Added a test function--large sig digits (from float.h) and a few extra functions. Updated all headers. Added NIST data files to data. --- NEW FILE: Michelso.dat --- 299.85 299.74 299.90 300.07 299.93 299.85 299.95 299.98 299.98 299.88 300.00 299.98 299.93 299.65 299.76 299.81 300.00 300.00 299.96 299.96 299.96 299.94 299.96 299.94 299.88 299.80 299.85 299.88 299.90 299.84 299.83 299.79 299.81 299.88 299.88 299.83 299.80 299.79 299.76 299.80 299.88 299.88 299.88 299.86 299.72 299.72 299.62 299.86 299.97 299.95 299.88 299.91 299.85 299.87 299.84 299.84 299.85 299.84 299.84 299.84 299.89 299.81 299.81 299.82 299.80 299.77 299.76 299.74 299.75 299.76 299.91 299.92 299.89 299.86 299.88 299.72 299.84 299.85 299.85 299.78 299.89 299.84 299.78 299.81 299.76 299.81 299.79 299.81 299.82 299.85 299.87 299.87 299.81 299.74 299.81 299.94 299.95 299.80 299.81 299.87 --- NEW FILE: NumAcc1.dat --- 10000001 10000003 10000002 --- NEW FILE: Norris.dat --- 0.1 0.2 338.8 337.4 118.1 118.2 888.0 884.6 9.2 10.1 228.1 226.5 668.5 666.3 998.5 996.3 449.1 448.6 778.9 777.0 559.2 558.2 0.3 0.4 0.1 0.6 778.1 775.5 668.8 666.9 339.3 338.0 448.9 447.5 10.8 11.6 557.7 556.0 228.3 228.1 998.0 995.8 888.8 887.6 119.6 120.2 0.3 0.3 0.6 0.3 557.6 556.8 339.3 339.1 888.0 887.2 998.5 999.0 778.9 779.0 10.2 11.1 117.6 118.3 228.9 229.2 668.4 669.1 449.2 448.9 0.2 0.5 --- NEW FILE: NoInt2.dat --- 3 4 4 5 4 6 --- NEW FILE: NumAcc3.dat --- 1000000.2 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 [...962 lines suppressed...] 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 1000000.1 1000000.3 --- NEW FILE: Mavro.dat --- 2.00180 2.00170 2.00180 2.00190 2.00180 2.00170 2.00150 2.00140 2.00150 2.00150 2.00170 2.00180 2.00180 2.00190 2.00190 2.00210 2.00200 2.00160 2.00140 2.00130 2.00130 2.00150 2.00150 2.00160 2.00150 2.00140 2.00130 2.00140 2.00150 2.00140 2.00150 2.00160 2.00150 2.00160 2.00190 2.00200 2.00200 2.00210 2.00220 2.00230 2.00240 2.00250 2.00270 2.00260 2.00260 2.00260 2.00270 2.00260 2.00250 2.00240 --- NEW FILE: NumAcc4.dat --- 10000000.2 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 [...962 lines suppressed...] 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 10000000.1 10000000.3 --- datafile.dat DELETED --- --- NEW FILE: NumAcc2.dat --- 1.2 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 [...962 lines suppressed...] 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 1.1 1.3 --- data.dat DELETED --- --- NEW FILE: NoInt1.dat --- 130 60 131 61 132 62 133 63 134 64 135 65 136 66 137 67 138 68 139 69 140 70 --- NEW FILE: Lottery.dat --- 162 671 933 414 788 730 817 33 536 875 670 236 473 167 877 980 316 950 456 92 517 557 956 954 104 178 794 278 147 773 437 435 502 610 582 780 689 562 964 791 28 97 848 281 858 538 660 972 671 613 867 448 738 966 139 636 847 659 754 243 122 455 195 968 793 59 730 361 574 522 97 762 431 158 429 414 22 629 788 999 187 215 810 782 47 34 108 986 25 644 829 630 315 567 919 331 207 412 242 607 668 944 749 168 864 442 533 805 372 63 458 777 416 340 436 140 919 350 510 572 905 900 85 389 473 758 444 169 625 692 140 897 672 288 312 860 724 226 884 508 976 741 476 417 831 15 318 432 241 114 799 955 833 358 935 146 630 830 440 642 356 373 271 715 367 393 190 669 8 861 108 795 269 590 326 866 64 523 862 840 219 382 998 4 628 305 747 247 34 747 729 645 856 974 24 568 24 694 608 480 410 729 947 293 53 930 223 203 677 227 62 455 387 318 562 242 428 968 --- data2.dat DELETED --- --- NEW FILE: Lew.dat --- -213 -564 -35 -15 141 115 -420 -360 203 -338 -431 194 -220 -513 154 -125 -559 92 -21 -579 -52 99 -543 -175 162 -457 -346 204 -300 -474 164 -107 -572 -8 83 -541 -224 180 -420 -374 201 -236 -531 83 27 -564 -112 131 -507 -254 199 -311 -495 143 -46 -579 -90 136 -472 -338 202 -287 -477 169 -124 -568 17 48 -568 -135 162 -430 -422 172 -74 -577 -13 92 -534 -243 194 -355 -465 156 -81 -578 -64 139 -449 -384 193 -198 -538 110 -44 -577 -6 66 -552 -164 161 -460 -344 205 -281 -504 134 -28 -576 -118 156 -437 -381 200 -220 -540 83 11 -568 -160 172 -414 -408 188 -125 -572 -32 139 -492 -321 205 -262 -504 142 -83 -574 0 48 -571 -106 137 -501 -266 190 -391 -406 194 -186 -553 83 -13 -577 -49 103 -515 -280 201 300 -506 131 -45 -578 -80 138 -462 -361 201 -211 -554 32 74 -533 -235 187 -372 -442 182 -147 -566 25 68 -535 -244 194 -351 -463 174 -125 -570 15 72 -550 -190 172 -424 -385 198 -218 -536 96 |
|
From: Mike H. B. <bik...@us...> - 2004-05-30 16:36:25
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26132/src Modified Files: output.c output.h statistics.c Log Message: Continue overhaul of output! Refined current functions. In statistics.c, put error message in the command of stats_main. Index: statistics.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** statistics.c 29 May 2004 19:59:23 -0000 1.33 --- statistics.c 30 May 2004 16:36:15 -0000 1.34 *************** *** 64,67 **** --- 64,69 ---- variable = x[0]; verified = make_vector (variable); + if (verified == false) + printf ("ERROR: Failed to make a vector!\n\n"); } *************** *** 69,72 **** --- 71,76 ---- { verified = make_matrix (x, type, how_much); + if (verified == false) + printf ("ERROR: Failed to make a matrix!\n\n"); } Index: output.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** output.h 29 May 2004 19:59:23 -0000 1.14 --- output.h 30 May 2004 16:36:15 -0000 1.15 *************** *** 1,17 **** /* functions in output.c for mistat ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* functions in output.c for mistat ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 30,33 **** --- 30,34 ---- #define MCOL 60 /* Maximum columin width is 60. */ #define MROW 100 /* Maximum number of rows is 100. */ + #define MLABEL 30 /* Maximum statistics label. */ /* Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** output.c 29 May 2004 19:59:23 -0000 1.29 --- output.c 30 May 2004 16:36:15 -0000 1.30 *************** *** 56,69 **** extern GetLine *gl; /* The getline variable for libtecla. */ int count_int, count_ld; /* Counts of respective types for making a matrix. */ /* * Functions */ bool setup_data (int vect_var[], int int_vars[], int ld_vars[]); /* Determine what to make (matrix/vector) and ask to make. */ bool desc (bool all_stats, int v[], int matrix_int_vars[], int matrix_ld_vars[]); /* Print descriptive tables. */ void format_output (char *input, double value); /* Adjust for number of sig digits. */ void free_which_data (int v[]); /* Frees up the build vector/matrix. */ - /*FIXME: break this up a bit. */ bool output_main (int v[], int routine, int stats_to_do) --- 56,74 ---- extern GetLine *gl; /* The getline variable for libtecla. */ int count_int, count_ld; /* Counts of respective types for making a matrix. */ + int Stop_Me; /* When to stop printing. */ + int Output_Size; /* Size of output string. */ + long double Results[11]; /* Results of analysis. */ + /* * Functions */ + void build_data_list (int v[], int int_count[], int ld_count[]); /* Fill the count vectors. */ bool setup_data (int vect_var[], int int_vars[], int ld_vars[]); /* Determine what to make (matrix/vector) and ask to make. */ bool desc (bool all_stats, int v[], int matrix_int_vars[], int matrix_ld_vars[]); /* Print descriptive tables. */ + void print_handler (int v[], int im, char stats_label[][MLABEL], char table_subheader[], char table_header[]); /* All printing is sent here. */ void format_output (char *input, double value); /* Adjust for number of sig digits. */ void free_which_data (int v[]); /* Frees up the build vector/matrix. */ bool output_main (int v[], int routine, int stats_to_do) *************** *** 82,109 **** return true; ! /* ! * See if we have one, or more than one variable. ! * Also, setups number of variable types. ! * An alternate to v is made for printing variable names. This is to accommodate for different types. ! * Basically, and index for cross-reference will be made for making output. ! */ ! while (v[i] >= 0) ! { ! if (Data_Type[v[i]] == INT_DATA) ! { ! ct_int[count_int] = v[i]; ! count_int++; ! } ! else if (Data_Type[v[i]] == FLOAT_DATA) ! { ! ct_ld[count_ld] = v[i]; ! count_ld++; ! } ! ! i++; ! Num_Vars++; ! } ! ! ct_int[count_int] = ct_ld[count_ld] = -1; /* Last value set to -1 for checks. */ /* Lets make a vector or matrix. */ --- 87,92 ---- return true; ! /* Use v to fill ct_int and ct_ld. */ ! build_data_list (v, ct_int, ct_ld); /* Lets make a vector or matrix. */ *************** *** 130,134 **** /* All finished so free up the matrix/vector. */ free_which_data (v); ! return true; } --- 113,145 ---- /* All finished so free up the matrix/vector. */ free_which_data (v); ! return verify; ! ! } ! ! void ! build_data_list (int v[], int ct_int[], int ct_ld[]) ! { ! int i; ! ! i = 0; ! while (v[i] >= 0) ! { ! if (Data_Type[v[i]] == INT_DATA) ! { ! ct_int[count_int] = v[i]; ! count_int++; ! } ! ! else if (Data_Type[v[i]] == FLOAT_DATA) ! { ! ct_ld[count_ld] = v[i]; ! count_ld++; ! } ! ! i++; ! Num_Vars++; ! } ! ! ct_int[count_int] = ct_ld[count_ld] = -1; /* Last value set to -1 for checks. */ } *************** *** 142,154 **** { verify = stats_main (vect_var, true, true, count_int); - - if (verify == false) - { - printf ("ERROR: Failed to make a vector!\n\n"); - return false; - } } ! else /* A bit complicated (too complicated?). But, make relevant matrix/vectors. */ { Flag_Vector = false; --- 153,159 ---- { verify = stats_main (vect_var, true, true, count_int); } ! else /* Make relevant matrix/vectors. */ { Flag_Vector = false; *************** *** 158,165 **** verify = stats_main (int_vars, false, true, count_int); if (verify == false) ! { ! printf ("ERROR: Failed to make a matrix!\n\n"); ! return false; ! } } --- 163,167 ---- verify = stats_main (int_vars, false, true, count_int); if (verify == false) ! return verify; } *************** *** 168,179 **** verify = stats_main (ld_vars, false, false, count_ld); if (verify == false) ! { ! printf ("ERROR: Failed to make a matrix!\n\n"); ! return false; ! } } } ! return true; } --- 170,178 ---- verify = stats_main (ld_vars, false, false, count_ld); if (verify == false) ! return verify; } } ! return verify; } *************** *** 183,216 **** { bool stat_test; ! char results_col[11][MROW]; ! char *p_output; ! int i, im, output_size, stop_me, offset, num_int, num_ld; ! long double results[11]; ! size_t j, k; /* * Set up the hard table values. */ ! char stats_label[11][20] = { ! {"Mean\t\t"}, ! {"SD\t\t"}, ! {"Skewness\t"}, ! {"Kurtosis\t"}, ! {"Sum\t\t"}, ! {"Min\t\t"}, ! {"Max\t\t"}, ! {"Median\t\t"}, ! {"Lower Quartile\t"}, ! {"Upper Quartile\t"}, ! {"IQR\t\t"} ! }; char table_header[] = "\nDescriptive Statistics for"; char table_subheader[] = "Statistics\tValue\n"; ! stop_me = 4; /* That is, only do until Sum. */ ! ! j = 6; /* Minimum length of results, or can fit "value". */ /* Populate the first row with title. */ ! output_size = sizeof (table_header); num_int = num_ld = offset = 0; --- 182,209 ---- { bool stat_test; ! int im, offset, num_int, num_ld; /* * Set up the hard table values. */ ! char stats_label[11][MLABEL] = { ! {"Mean\t\t"}, ! {"SD\t\t"}, ! {"Skewness\t"}, ! {"Kurtosis\t"}, ! {"Sum\t\t"}, ! {"Min\t\t"}, ! {"Max\t\t"}, ! {"Median\t\t"}, ! {"Lower Quartile\t"}, ! {"Upper Quartile\t"}, ! {"IQR\t\t"} ! }; char table_header[] = "\nDescriptive Statistics for"; char table_subheader[] = "Statistics\tValue\n"; ! Stop_Me = 4; /* That is, only do until Sum. */ /* Populate the first row with title. */ ! Output_Size = sizeof (table_header); num_int = num_ld = offset = 0; *************** *** 223,227 **** if (Flag_Vector) /* Vector for analysis. */ { ! stat_test = get_mean (Flag_Vector, im, im, results); if (stat_test == false) return false; --- 216,220 ---- if (Flag_Vector) /* Vector for analysis. */ { ! stat_test = get_mean (Flag_Vector, im, im, Results); if (stat_test == false) return false; *************** *** 229,236 **** if (all_stats == true) { ! stat_test = get_sorted_stats (Flag_Vector, im, im, results); if (stat_test == false) return false; ! stop_me = 10; } --- 222,229 ---- if (all_stats == true) { ! stat_test = get_sorted_stats (Flag_Vector, im, im, Results); if (stat_test == false) return false; ! Stop_Me = 10; } *************** *** 244,248 **** stat_test = get_mean (Flag_Vector, matrix_ld_vars[num_ld], num_ld, ! results); if (stat_test == false) return false; --- 237,241 ---- stat_test = get_mean (Flag_Vector, matrix_ld_vars[num_ld], num_ld, ! Results); if (stat_test == false) return false; *************** *** 251,260 **** stat_test = get_sorted_stats (Flag_Vector, matrix_ld_vars[num_ld], ! num_ld, results); if (stat_test == false) return false; ! stop_me = 10; } --- 244,253 ---- stat_test = get_sorted_stats (Flag_Vector, matrix_ld_vars[num_ld], ! num_ld, Results); if (stat_test == false) return false; ! Stop_Me = 10; } *************** *** 267,271 **** stat_test = get_mean (Flag_Vector, matrix_int_vars[num_int], num_int, ! results); if (stat_test == false) return false; --- 260,264 ---- stat_test = get_mean (Flag_Vector, matrix_int_vars[num_int], num_int, ! Results); if (stat_test == false) return false; *************** *** 275,284 **** stat_test = get_sorted_stats (Flag_Vector, matrix_int_vars[num_int], ! num_int, results); if (stat_test == false) return false; ! stop_me = 10; } --- 268,277 ---- stat_test = get_sorted_stats (Flag_Vector, matrix_int_vars[num_int], ! num_int, Results); if (stat_test == false) return false; ! Stop_Me = 10; } *************** *** 290,337 **** /* Lets get the title in. Determine how big the variable name is! */ /* Pad for log, space, and \n. */ ! output_size += sizeof (table_subheader) + log (offset + 1) + 3; - /* - * Populate the results_col for sig digits. Also, - * raise the value of output_size to match results_col. - */ - for (i = 0; i <= stop_me; i++) - { - format_output (results_col[i], results[i]); - if ((k = strlen (results_col[i])) > j) - { - j = k; - } - output_size += j + strlen (stats_label[i]); - } - p_output = (char *) malloc (output_size * sizeof (char)); - if (p_output == NULL) - { - printf ("ERROR: cannot allocate memory for output\n"); - break; - } ! /* ! * Make the table. ! */ ! sprintf (p_output, "%s %d\n", table_header, v[im] + 1); ! strcat (p_output, table_subheader); ! for (i = 0; i <= stop_me; i++) { ! strcat (p_output, stats_label[i]); ! strcat (p_output, results_col[i]); } ! /* Finally, print and free. */ ! printf ("%s", p_output); ! update_logfile (p_output); ! free (p_output); ! ! /*FIXME: This needs upped. */ ! gl_get_line (gl, "Hit Enter to Continue", NULL, -1); } ! return true; } --- 283,340 ---- /* Lets get the title in. Determine how big the variable name is! */ /* Pad for log, space, and \n. */ ! Output_Size += sizeof (table_subheader) + log (offset + 1) + 3; ! /* Print output. */ ! print_handler (v, im, stats_label, table_subheader, table_header); ! } ! ! return true; ! ! } ! ! void ! print_handler (int v[], int im, char stats_label[][MLABEL], ! char table_subheader[], char table_header[]) ! { ! char results_col[MROW][MCOL]; ! char *p_output; ! int i; ! size_t j, k; ! ! j = 6; /* Minimum length of Results, or can fit "value". */ ! for (i = 0; i <= Stop_Me; i++) ! { ! format_output (results_col[i], Results[i]); ! if ((k = strlen (results_col[i])) > j) { ! j = k; } + Output_Size += j + strlen (stats_label[i]); + } ! p_output = (char *) malloc (Output_Size * sizeof (char)); ! if (p_output == NULL) ! { ! printf ("ERROR: cannot allocate memory for output\n"); ! exit (EXIT_FAILURE); ! } + sprintf (p_output, "%s %d\n", table_header, v[im] + 1); + strcat (p_output, table_subheader); + for (i = 0; i <= Stop_Me; i++) + { + strcat (p_output, stats_label[i]); + strcat (p_output, results_col[i]); } ! printf ("%s", p_output); ! update_logfile (p_output); ! ! /* Finally, print and free. */ ! free (p_output); ! ! /*FIXME: This needs upped. */ ! gl_get_line (gl, "Hit Enter to Continue", NULL, -1); } *************** *** 400,407 **** free_data (FREE_VECTOR_LD); else ! { ! printf ("ERROR: bad what to free in output_main for vector.\n"); ! exit (EXIT_FAILURE); ! } } --- 403,407 ---- free_data (FREE_VECTOR_LD); else ! printf ("ERROR: bad what to free in output_main for vector.\n"); } *************** *** 418,437 **** } - /*Main output structure - - Sequence: - get table input: regression, descriptive, and so on - get length of results - - generate table (all to the sprintf thing) - 1. title - 2. top bar - 3. labels - 4. sub bar - 5. results - 7. bottom bars - 8. again for other tables--e.g. regression - output - */ - /*Here ends output.c. */ --- 418,420 ---- |
|
From: Mike H. B. <bik...@us...> - 2004-05-30 16:36:24
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26132 Modified Files: ChangeLog Log Message: Continue overhaul of output! Refined current functions. In statistics.c, put error message in the command of stats_main. Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ChangeLog 29 May 2004 19:59:22 -0000 1.23 --- ChangeLog 30 May 2004 16:36:15 -0000 1.24 *************** *** 1,2 **** --- 1,9 ---- + 2004-05-31 Mike H. Benton (bik...@us...) + *src/statistics.c (stats_main): Change in the use of verify--message printed here. + + *src/output.c: Continue overhaul. Spliting up of functions. + *src/output.h: Addition of MLABEL + + 2004-05-30 Mike H. Benton (bik...@us...) *src: Clean up of variable names. A style thing, and removed extras. |
|
From: Mike H. B. <bik...@us...> - 2004-05-29 20:07:48
|
Update of /cvsroot/mistat/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31993 Modified Files: index.html Log Message: Updates about status. Index: index.html =================================================================== RCS file: /cvsroot/mistat/website/index.html,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** index.html 5 May 2004 08:11:52 -0000 1.11 --- index.html 29 May 2004 20:07:39 -0000 1.12 *************** *** 29,45 **** Donate to mistat</a></b></p> ! <h2>mistat Current Information (4/5/2004)</h2> ! <p>I have started the dual conversion to libmistat and ! updating functions in the statistics.c. So far, mean and ! variance are back. As functions are added and tested in ! libmistat, I will update mistat. My goal is to have all basic ! descriptive's back in a week.</p> ! <p>The output is still being overhauled. Several other ! functions have been reworked to support this. Only basic ! descriptive's are supported and the output is not that ! good.</p> <h3><a href="http://sourceforge.net/project/showfiles.php?group_id=87816"> --- 29,39 ---- Donate to mistat</a></b></p> ! <h2>mistat Current Information (5/30/2004)</h2> ! <p>Descriptives are back. Also, mutitilpe data dypes are supported (ie, data files can be float, int or both). However, no support for missing. My next project!</p> ! <p>The output is still being overhauled. The basic overhaul is completed.</p> + <p>Once I have regression, t-tests, and correlations in limbistat and mistat I will call it an alpha release. Give me about two months.</p> <h3><a href="http://sourceforge.net/project/showfiles.php?group_id=87816"> |
|
From: Mike H. B. <bik...@us...> - 2004-05-29 19:59:36
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30640/src Modified Files: error.c file_ops.c file_ops.h main.c main.h menu.c output.c output.h statistics.c system.h Log Message: Variable name cleanup. Added multiple vars for sorted stats in statistics.c. Index: statistics.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** statistics.c 29 May 2004 18:22:23 -0000 1.32 --- statistics.c 29 May 2004 19:59:23 -0000 1.33 *************** *** 38,42 **** #include "main.h" /*Use of data file name from main. */ - #include "output.h" /*Use of NUM_VARS. */ /* Set up the matrix and vector variables.*/ --- 38,41 ---- *************** *** 95,104 **** if (Data_Type[for_type] == INT_DATA) { ! results[0] = mean_int_vector (vta, index, nrows, &sum); ! results[1] = var_int_vector (vta, &results[0], index, nrows); results[2] = ! skewness_int_vector (vta, &results[1], &results[0], nrows); results[3] = ! kurtosis_int_vector (vta, &results[1], &results[0], nrows); results[4] = sum; results[1] = sqrt (results[1]); --- 94,103 ---- if (Data_Type[for_type] == INT_DATA) { ! results[0] = mean_int_vector (vta, index, Nrows, &sum); ! results[1] = var_int_vector (vta, &results[0], index, Nrows); results[2] = ! skewness_int_vector (vta, &results[1], &results[0], Nrows); results[3] = ! kurtosis_int_vector (vta, &results[1], &results[0], Nrows); results[4] = sum; results[1] = sqrt (results[1]); *************** *** 107,116 **** else if (Data_Type[for_type] == FLOAT_DATA) { ! results[0] = mean_ld_vector (vldta, index, nrows, &ld_sum); ! results[1] = var_ld_vector (vldta, &results[0], index, nrows); results[2] = ! skewness_ld_vector (vldta, &results[1], &results[0], nrows); results[3] = ! kurtosis_ld_vector (vldta, &results[1], &results[0], nrows); results[4] = ld_sum; results[1] = sqrt (results[1]); --- 106,115 ---- else if (Data_Type[for_type] == FLOAT_DATA) { ! results[0] = mean_ld_vector (vldta, index, Nrows, &ld_sum); ! results[1] = var_ld_vector (vldta, &results[0], index, Nrows); results[2] = ! skewness_ld_vector (vldta, &results[1], &results[0], Nrows); results[3] = ! kurtosis_ld_vector (vldta, &results[1], &results[0], Nrows); results[4] = ld_sum; results[1] = sqrt (results[1]); *************** *** 129,138 **** if (Data_Type[for_type] == INT_DATA) { ! results[0] = mean_int_matrix (mta, index, nrows, &sum); ! results[1] = var_int_matrix (mta, &results[0], index, nrows); results[2] = ! skewness_int_matrix (mta, index, &results[1], &results[0], nrows); results[3] = ! kurtosis_int_matrix (mta, index, &results[1], &results[0], nrows); results[4] = sum; results[1] = sqrt (results[1]); --- 128,137 ---- if (Data_Type[for_type] == INT_DATA) { ! results[0] = mean_int_matrix (mta, index, Nrows, &sum); ! results[1] = var_int_matrix (mta, &results[0], index, Nrows); results[2] = ! skewness_int_matrix (mta, index, &results[1], &results[0], Nrows); results[3] = ! kurtosis_int_matrix (mta, index, &results[1], &results[0], Nrows); results[4] = sum; results[1] = sqrt (results[1]); *************** *** 141,152 **** else if (Data_Type[for_type] == FLOAT_DATA) { ! results[0] = mean_ld_matrix (mldta, index, nrows, &ld_sum); ! results[1] = var_ld_matrix (mldta, &results[0], index, nrows); results[2] = skewness_ld_matrix (mldta, index, &results[1], &results[0], ! nrows); results[3] = kurtosis_ld_matrix (mldta, index, &results[1], &results[0], ! nrows); results[4] = ld_sum; results[1] = sqrt (results[1]); --- 140,151 ---- else if (Data_Type[for_type] == FLOAT_DATA) { ! results[0] = mean_ld_matrix (mldta, index, Nrows, &ld_sum); ! results[1] = var_ld_matrix (mldta, &results[0], index, Nrows); results[2] = skewness_ld_matrix (mldta, index, &results[1], &results[0], ! Nrows); results[3] = kurtosis_ld_matrix (mldta, index, &results[1], &results[0], ! Nrows); results[4] = ld_sum; results[1] = sqrt (results[1]); *************** *** 173,191 **** if (is_vector) /*Process vector data. */ { ! results[5] = vector_int_min (vta); ! results[6] = vector_int_max (vta); ! q_sort_int_vector (vta, 1, nrows); ! results[7] = median_int_vector (vta, nrows); ! quartiles_int_vector (vta, nrows, &results[8], &results[9]); } else /*We have a matrix. */ { ! results[5] = matrix_int_min (mta, index); ! results[6] = matrix_int_max (mta, index); ! q_sort_int_matrix (mta, index, 1, nrows); ! results[7] = median_int_matrix (mta, index, nrows); ! quartiles_int_matrix (mta, index, nrows, &results[8], &results[9]); } --- 172,226 ---- if (is_vector) /*Process vector data. */ { ! if (Data_Type[for_type] == INT_DATA) ! { ! ! results[5] = vector_int_min (vta); ! results[6] = vector_int_max (vta); ! q_sort_int_vector (vta, 1, Nrows); ! results[7] = median_int_vector (vta, Nrows); ! quartiles_int_vector (vta, Nrows, &results[8], &results[9]); ! } ! ! else if (Data_Type[for_type] == FLOAT_DATA) ! { ! results[5] = vector_ld_min (vldta); ! results[6] = vector_ld_max (vldta); ! q_sort_ld_vector (vldta, 1, Nrows); ! results[7] = median_ld_vector (vldta, Nrows); ! quartiles_ld_vector (vldta, Nrows, &results[8], &results[9]); ! } ! ! else ! { ! printf ("ERROR: wrong data type for vector in get_mean.\n"); ! return false; ! } } else /*We have a matrix. */ { + if (Data_Type[for_type] == INT_DATA) + { + results[5] = matrix_int_min (mta, index); + results[6] = matrix_int_max (mta, index); + q_sort_int_matrix (mta, index, 1, Nrows); + results[7] = median_int_matrix (mta, index, Nrows); + quartiles_int_matrix (mta, index, Nrows, &results[8], &results[9]); + } ! else if (Data_Type[for_type] == FLOAT_DATA) ! { ! results[5] = matrix_ld_min (mldta, index); ! results[6] = matrix_ld_max (mldta, index); ! q_sort_ld_matrix (mldta, index, 1, Nrows); ! results[7] = median_ld_matrix (mldta, index, Nrows); ! quartiles_ld_matrix (mldta, index, Nrows, &results[8], &results[9]); ! } ! ! else ! { ! printf ("ERROR: wrong data type for matrix in get_mean.\n"); ! return false; ! } } *************** *** 211,215 **** if (Data_Type[var_column] == INT_DATA) { ! vta = vector_int_calloc (nrows); if (vta == NULL) --- 246,250 ---- if (Data_Type[var_column] == INT_DATA) { ! vta = vector_int_calloc (Nrows); if (vta == NULL) *************** *** 223,227 **** else if (Data_Type[var_column] == FLOAT_DATA) { ! vldta = vector_ld_calloc (nrows); if (vldta == NULL) --- 258,262 ---- else if (Data_Type[var_column] == FLOAT_DATA) { ! vldta = vector_ld_calloc (Nrows); if (vldta == NULL) *************** *** 240,248 **** /*Fill t with data. */ ! getit (data_file, var_column, t); /*Put t into a vector. */ ! while (i < nrows) { if (Data_Type[var_column] == INT_DATA) --- 275,283 ---- /*Fill t with data. */ ! getit (Data_File, var_column, t); /*Put t into a vector. */ ! while (i < Nrows) { if (Data_Type[var_column] == INT_DATA) *************** *** 274,278 **** if (type == true) { ! mta = matrix_int_calloc (nrows, how_much); if (mta == NULL) --- 309,313 ---- if (type == true) { ! mta = matrix_int_calloc (Nrows, how_much); if (mta == NULL) *************** *** 286,290 **** else { ! mldta = matrix_ld_calloc (nrows, how_much); if (mldta == NULL) --- 321,325 ---- else { ! mldta = matrix_ld_calloc (Nrows, how_much); if (mldta == NULL) *************** *** 301,308 **** temp = x[i]; ! getit (data_file, temp, t); c = 0; ! while (c < nrows) { if (type == true) --- 336,343 ---- temp = x[i]; ! getit (Data_File, temp, t); c = 0; ! while (c < Nrows) { if (type == true) Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** output.c 29 May 2004 18:22:23 -0000 1.28 --- output.c 29 May 2004 19:59:23 -0000 1.29 *************** *** 34,44 **** - - #include "output.h" #include "statistics.h" /* Calls to statistical routines. */ #include "main.h" /* Flag variables (print_digits). */ #include "menu.h" /* Enumeration values, and MAX_VAR_INPUT. */ ! #include "file_ops.h" /* Sending data to the logfile. */ #include "system.h" /* Bool and config.h calls. */ --- 34,42 ---- #include "output.h" #include "statistics.h" /* Calls to statistical routines. */ #include "main.h" /* Flag variables (print_digits). */ #include "menu.h" /* Enumeration values, and MAX_VAR_INPUT. */ ! #include "file_ops.h" /* Sending data to the Log_File. */ #include "system.h" /* Bool and config.h calls. */ *************** *** 53,58 **** * Variables */ ! bool FLAG_VECTOR; /* Vector or matrix (number of variables = 1). */ ! int NUM_VARS; /* Number of variables for analysis. */ extern GetLine *gl; /* The getline variable for libtecla. */ int count_int, count_ld; /* Counts of respective types for making a matrix. */ --- 51,57 ---- * Variables */ ! bool Flag_Vector; /* Vector or matrix (number of variables = 1). */ ! /* FIXME: Consider makeing local and passing. */ ! int Num_Vars; /* Number of variables for analysis. */ extern GetLine *gl; /* The getline variable for libtecla. */ int count_int, count_ld; /* Counts of respective types for making a matrix. */ *************** *** 61,64 **** --- 60,64 ---- * Functions */ + bool setup_data (int vect_var[], int int_vars[], int ld_vars[]); /* Determine what to make (matrix/vector) and ask to make. */ bool desc (bool all_stats, int v[], int matrix_int_vars[], int matrix_ld_vars[]); /* Print descriptive tables. */ void format_output (char *input, double value); /* Adjust for number of sig digits. */ *************** *** 74,82 **** assert (routine >= 100 && routine <= 103); ! FLAG_VECTOR = true; /* Default is just true because most people will just look at one variable:D */ ! NUM_VARS = count_int = count_ld = 0; ! ! /* FIXME: do something with stats_to_do! */ ! i = stats_to_do; /* Double check to make sure we have something. */ --- 74,79 ---- assert (routine >= 100 && routine <= 103); ! Flag_Vector = true; /* Default is just true because most people will just look at one variable:D */ ! Num_Vars = count_int = count_ld = 0; /* Double check to make sure we have something. */ *************** *** 85,94 **** return true; ! /* ! * See if we have one, or more than one variable. ! * Also, setups number of variable types. ! * An alternate to v is made for printing variable names. This is to accomdated for different types. ! * Basically, and index for cross-reference will be made for makeing output. ! */ while (v[i] >= 0) { --- 82,91 ---- return true; ! /* ! * See if we have one, or more than one variable. ! * Also, setups number of variable types. ! * An alternate to v is made for printing variable names. This is to accommodate for different types. ! * Basically, and index for cross-reference will be made for making output. ! */ while (v[i] >= 0) { *************** *** 105,109 **** i++; ! NUM_VARS++; } --- 102,106 ---- i++; ! Num_Vars++; } *************** *** 111,117 **** /* Lets make a vector or matrix. */ ! if (NUM_VARS == 1) /* Vector is simple! Just up and go. */ { ! verify = stats_main (v, true, true, count_int); if (verify == false) --- 108,145 ---- /* Lets make a vector or matrix. */ ! verify = setup_data (v, ct_int, ct_ld); ! if (verify == false) ! return verify; ! ! /*Now we can go on to the analysis. */ ! switch (routine) { ! case descriptives: ! verify = desc (false, v, ct_int, ct_ld); ! break; ! ! case more_descriptives: ! verify = desc (true, v, ct_int, ct_ld); ! break; ! ! default: ! printf ("ERROR: Invalid routine in output_main\n"); ! return false; ! } ! ! /* All finished so free up the matrix/vector. */ ! free_which_data (v); ! return true; ! ! } ! ! bool ! setup_data (int vect_var[], int int_vars[], int ld_vars[]) ! { ! bool verify; ! ! if (Num_Vars == 1) /* Vector is simple! Just up and go. */ ! { ! verify = stats_main (vect_var, true, true, count_int); if (verify == false) *************** *** 124,132 **** else /* A bit complicated (too complicated?). But, make relevant matrix/vectors. */ { ! FLAG_VECTOR = false; if (count_int >= 1) { ! verify = stats_main (ct_int, false, true, count_int); if (verify == false) { --- 152,160 ---- else /* A bit complicated (too complicated?). But, make relevant matrix/vectors. */ { ! Flag_Vector = false; if (count_int >= 1) { ! verify = stats_main (int_vars, false, true, count_int); if (verify == false) { *************** *** 138,142 **** if (count_ld >= 1) { ! verify = stats_main (ct_ld, false, false, count_ld); if (verify == false) { --- 166,170 ---- if (count_ld >= 1) { ! verify = stats_main (ld_vars, false, false, count_ld); if (verify == false) { *************** *** 147,169 **** } - - /*Now we can go on to the analysis. */ - switch (routine) - { - case descriptives: - verify = desc (false, v, ct_int, ct_ld); - break; - - case more_descriptives: - verify = desc (true, v, ct_int, ct_ld); - break; - - default: - printf ("ERROR: Invalid routine in output_main\n"); - return false; - } - - /* All finished so free up the matrix/vector. */ - free_which_data (v); return true; --- 175,178 ---- *************** *** 209,218 **** * Loop through the variables, and print output. */ ! for (im = 0; im <= NUM_VARS - 1; im++) { /* Get the stats. */ ! if (FLAG_VECTOR) /* Vector for analysis. */ { ! stat_test = get_mean (FLAG_VECTOR, im, im, results); if (stat_test == false) return false; --- 218,227 ---- * Loop through the variables, and print output. */ ! for (im = 0; im <= Num_Vars - 1; im++) { /* Get the stats. */ ! if (Flag_Vector) /* Vector for analysis. */ { ! stat_test = get_mean (Flag_Vector, im, im, results); if (stat_test == false) return false; *************** *** 220,224 **** if (all_stats == true) { ! stat_test = get_sorted_stats (FLAG_VECTOR, im, im, results); if (stat_test == false) return false; --- 229,233 ---- if (all_stats == true) { ! stat_test = get_sorted_stats (Flag_Vector, im, im, results); if (stat_test == false) return false; *************** *** 233,237 **** if (num_ld < count_ld) { ! stat_test = get_mean (FLAG_VECTOR, matrix_ld_vars[num_ld], num_ld, results); if (stat_test == false) return false; --- 242,248 ---- if (num_ld < count_ld) { ! stat_test = ! get_mean (Flag_Vector, matrix_ld_vars[num_ld], num_ld, ! results); if (stat_test == false) return false; *************** *** 239,271 **** { stat_test = ! get_sorted_stats (FLAG_VECTOR, matrix_ld_vars[num_ld], num_ld, results); ! if (stat_test == false) return false; ! stop_me = 10; } ! offset = matrix_ld_vars[num_ld]; num_ld++; } ! else if (num_int < count_int) { ! stat_test = get_mean (FLAG_VECTOR, matrix_int_vars[num_int], num_int, results); if (stat_test == false) return false; ! if (all_stats == true) { stat_test = ! get_sorted_stats (FLAG_VECTOR, matrix_int_vars[num_int], num_int, results); ! if (stat_test == false) return false; ! stop_me = 10; } ! offset = matrix_int_vars[num_int]; num_int++; --- 250,286 ---- { stat_test = ! get_sorted_stats (Flag_Vector, matrix_ld_vars[num_ld], ! num_ld, results); ! if (stat_test == false) return false; ! stop_me = 10; } ! offset = matrix_ld_vars[num_ld]; num_ld++; } ! else if (num_int < count_int) { ! stat_test = ! get_mean (Flag_Vector, matrix_int_vars[num_int], num_int, ! results); if (stat_test == false) return false; ! if (all_stats == true) { stat_test = ! get_sorted_stats (Flag_Vector, matrix_int_vars[num_int], ! num_int, results); ! if (stat_test == false) return false; ! stop_me = 10; } ! offset = matrix_int_vars[num_int]; num_int++; *************** *** 273,277 **** } ! /* Lets get the title in. Determing how big the variable name is! */ /* Pad for log, space, and \n. */ output_size += sizeof (table_subheader) + log (offset + 1) + 3; --- 288,292 ---- } ! /* Lets get the title in. Determine how big the variable name is! */ /* Pad for log, space, and \n. */ output_size += sizeof (table_subheader) + log (offset + 1) + 3; *************** *** 279,283 **** /* * Populate the results_col for sig digits. Also, ! * rasie the value of output_size to match results_col. */ for (i = 0; i <= stop_me; i++) --- 294,298 ---- /* * Populate the results_col for sig digits. Also, ! * raise the value of output_size to match results_col. */ for (i = 0; i <= stop_me; i++) *************** *** 325,331 **** format_output (char *input, double value) { ! assert (print_digit >= 0 && print_digit <= 8); ! switch (print_digit) { --- 340,346 ---- format_output (char *input, double value) { ! assert (Print_Digit >= 0 && Print_Digit <= 8); ! switch (Print_Digit) { *************** *** 367,371 **** default: ! printf ("ERROR: not a valid print_digit in format_output!\n\n"); break; } --- 382,386 ---- default: ! printf ("ERROR: not a valid Print_Digit in format_output!\n\n"); break; } *************** *** 377,381 **** { int i; ! if (FLAG_VECTOR) { i = v[0]; --- 392,396 ---- { int i; ! if (Flag_Vector) { i = v[0]; Index: file_ops.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** file_ops.h 29 May 2004 18:22:23 -0000 1.10 --- file_ops.h 29 May 2004 19:59:23 -0000 1.11 *************** *** 19,23 **** */ /*file_ops.h*/ ! /*USAGE: Doing anything with a file, also when using nrows or columns.*/ #ifndef FILE_OPS_H #define FILE_OPS_H --- 19,23 ---- */ /*file_ops.h*/ ! /*USAGE: Doing anything with a file, also when using Nrows or Columns.*/ #ifndef FILE_OPS_H #define FILE_OPS_H *************** *** 52,57 **** * Extern data */ ! extern int nrows; /*number of rows in data file */ ! extern int columns; /*number of columns in a data file */ /* * Data_Type is an array containing the type of data for each respective variable. --- 52,57 ---- * Extern data */ ! extern int Nrows; /*number of rows in data file */ ! extern int Columns; /*number of columns in a data file */ /* * Data_Type is an array containing the type of data for each respective variable. Index: main.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** main.h 29 May 2004 18:22:23 -0000 1.11 --- main.h 29 May 2004 19:59:23 -0000 1.12 *************** *** 38,46 **** * Extern data */ ! FILE *data_file; ! FILE *logfile; ! extern int print_digit; ! extern char *ptr_data_file_name; ! extern char data_file_name[]; #endif --- 38,45 ---- * Extern data */ ! FILE *Data_File; ! FILE *Log_File; ! extern int Print_Digit; ! extern char Data_File_Name[]; #endif Index: file_ops.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** file_ops.c 29 May 2004 18:22:23 -0000 1.11 --- file_ops.c 29 May 2004 19:59:23 -0000 1.12 *************** *** 32,37 **** ! int nrows; /*The number of rows in the data file */ ! int columns; /*The number of columns in the data file */ int Data_Type[MAXCOLS]; /* The type of data for each variable. */ --- 32,37 ---- ! int Nrows; /*The number of rows in the data file */ ! int Columns; /*The number of Columns in the data file */ int Data_Type[MAXCOLS]; /* The type of data for each variable. */ *************** *** 107,112 **** temp_fp = file_name; ! nrows = 0; ! columns = 0; if (file_name == NULL) --- 107,112 ---- temp_fp = file_name; ! Nrows = 0; ! Columns = 0; if (file_name == NULL) *************** *** 115,119 **** "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", strerror (errno)); ! nrows = columns = -1; /* Set to -1 for error checks elsewhere. */ } --- 115,119 ---- "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", strerror (errno)); ! Nrows = Columns = -1; /* Set to -1 for error checks elsewhere. */ } *************** *** 123,127 **** { ! if (nrows >= MAXROWS) { fprintf (stderr, --- 123,127 ---- { ! if (Nrows >= MAXROWS) { fprintf (stderr, *************** *** 133,146 **** n = getwords (line, words, MAXCOLS); ! if (columns < n) ! columns = n; ! nrows++; } } printf ! ("\nThere are %d rows (cases)\n\tand %d columns (variables) in the data set\n", ! nrows, columns); } --- 133,146 ---- n = getwords (line, words, MAXCOLS); ! if (Columns < n) ! Columns = n; ! Nrows++; } } printf ! ("\nThere are %d rows (cases)\n\tand %d Columns (variables) in the data set\n", ! Nrows, Columns); } *************** *** 292,298 **** { ! rewind (logfile); printf ("LOGFILE\n\n"); ! printline (logfile); } --- 292,298 ---- { ! rewind (Log_File); printf ("LOGFILE\n\n"); ! printline (Log_File); } *************** *** 319,326 **** update_logfile (char *message) { ! if (log_file_flag) { ! if ((fprintf (logfile, "\n\n")) < 0) { fprintf (stderr, --- 319,326 ---- update_logfile (char *message) { ! if (Log_File_Flag) { ! if ((fprintf (Log_File, "\n\n")) < 0) { fprintf (stderr, *************** *** 330,338 **** } ! fprintf (logfile, "%s", message); /*Only need for Cygwin */ /*Seems to do no harm in Linux */ ! if ((fflush (logfile)) == EOF) { printf ("Unable to flush the logfile!\n"); --- 330,338 ---- } ! fprintf (Log_File, "%s", message); /*Only need for Cygwin */ /*Seems to do no harm in Linux */ ! if ((fflush (Log_File)) == EOF) { printf ("Unable to flush the logfile!\n"); *************** *** 343,347 **** /* ! * Use to read only certain columns. * Fills t[]. Element is column of data set. * Returns to be worked out --- 343,347 ---- /* ! * Use to read only certain Columns. * Fills t[]. Element is column of data set. * Returns to be worked out *************** *** 360,366 **** i = 0; - /*Need to work this up! */ - double_data = false; - if (file_name == NULL) { --- 360,363 ---- *************** *** 374,378 **** { ! rewind (data_file); while (fgetline (temp_fp, line, MAXLINE) != EOF) --- 371,375 ---- { ! rewind (Data_File); while (fgetline (temp_fp, line, MAXLINE) != EOF) Index: output.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** output.h 20 May 2004 16:52:22 -0000 1.13 --- output.h 29 May 2004 19:59:23 -0000 1.14 *************** *** 44,48 **** * Extern Data */ ! extern int NUM_VARS; /*Number of variables to analyze. */ #endif --- 44,48 ---- * Extern Data */ ! extern int Num_Vars; /*Number of variables to analyze. */ #endif Index: error.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/error.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** error.c 29 May 2004 18:22:23 -0000 1.9 --- error.c 29 May 2004 19:59:23 -0000 1.10 *************** *** 50,54 **** { printf ("\n\n"); ! if (bell) printf ("\a"); printf ("SIGABRT: From abort!%d\n", sig_value); --- 50,54 ---- { printf ("\n\n"); ! if (Bell) printf ("\a"); printf ("SIGABRT: From abort!%d\n", sig_value); *************** *** 60,64 **** { printf ("\n\n"); ! if (bell) printf ("\a"); printf ("SIGFPE: Math error: divide by 0 or overflow! Value: ->%d<-.\n", --- 60,64 ---- { printf ("\n\n"); ! if (Bell) printf ("\a"); printf ("SIGFPE: Math error: divide by 0 or overflow! Value: ->%d<-.\n", *************** *** 71,75 **** { printf ("\n\n"); ! if (bell) printf ("\a"); printf ("SIGILL: Illegal instruction! %d\n", sig_value); --- 71,75 ---- { printf ("\n\n"); ! if (Bell) printf ("\a"); printf ("SIGILL: Illegal instruction! %d\n", sig_value); *************** *** 81,85 **** { printf ("\n\n"); ! if (bell) printf ("\a"); printf ("SIGINT: Interrupt! A ctrl-c!%d\n", sig_value); --- 81,85 ---- { printf ("\n\n"); ! if (Bell) printf ("\a"); printf ("SIGINT: Interrupt! A ctrl-c!%d\n", sig_value); *************** *** 91,95 **** { printf ("\n\n"); ! if (bell) printf ("\a"); printf ("SIGSEGV: invalid access to storage! Value: ->%d<-.\n", sig_value); --- 91,95 ---- { printf ("\n\n"); ! if (Bell) printf ("\a"); printf ("SIGSEGV: invalid access to storage! Value: ->%d<-.\n", sig_value); *************** *** 101,105 **** { printf ("\n\n"); ! if (bell) printf ("\a"); printf ("SIGTERM: Termination request sent!%d\n", sig_value); --- 101,105 ---- { printf ("\n\n"); ! if (Bell) printf ("\a"); printf ("SIGTERM: Termination request sent!%d\n", sig_value); Index: main.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** main.c 29 May 2004 18:22:23 -0000 1.14 --- main.c 29 May 2004 19:59:23 -0000 1.15 *************** *** 62,70 **** * variables */ ! char logfile_name[] = "mistat.log"; /*Hard code of log file */ static struct gengetopt_args_info args_info; /*command line structure */ ! bool data_file_exist; /*flag to indicate data file can be opened */ ! char data_file_name[MAXFILENAME]; /* Name of data file. */ ! int print_digit; /*Number of digits to print. */ GetLine *gl; /*For libtecla GetLine functions. */ --- 62,70 ---- * variables */ ! char Logfile_Name[] = "mistat.log"; /*Hard code of log file */ static struct gengetopt_args_info args_info; /*command line structure */ ! bool Data_File_Exist; /*flag to indicate data file can be opened */ ! char Data_File_Name[MAXFILENAME]; /* Name of data file. */ ! int Print_Digit; /*Number of digits to print. */ GetLine *gl; /*For libtecla GetLine functions. */ *************** *** 123,140 **** /*Set bell */ ! bell = false; if (!args_info.nobell_flag) { ! bell = true; printf ("\aBell Active\a\n"); } /*Set precision digits */ ! print_digit = 2; if (args_info.digits_arg != 2) { if (args_info.digits_arg >= 0 && args_info.digits_arg <= 8) ! print_digit = args_info.digits_arg; else --- 123,140 ---- /*Set bell */ ! Bell = false; if (!args_info.nobell_flag) { ! Bell = true; printf ("\aBell Active\a\n"); } /*Set precision digits */ ! Print_Digit = 2; if (args_info.digits_arg != 2) { if (args_info.digits_arg >= 0 && args_info.digits_arg <= 8) ! Print_Digit = args_info.digits_arg; else *************** *** 144,160 **** } } ! printf ("Print digit is ->%d<-\n\n", print_digit); /*determine if log_file should be opened */ /*if so, open it! */ ! log_file_flag = false; if (args_info.log_flag) { ! logfile = open_file (logfile_name, 3); ! log_file_flag = true; ! if (logfile == NULL) { printf --- 144,160 ---- } } ! printf ("Print digit is ->%d<-\n\n", Print_Digit); /*determine if log_file should be opened */ /*if so, open it! */ ! Log_File_Flag = false; if (args_info.log_flag) { ! Log_File = open_file (Logfile_Name, 3); ! Log_File_Flag = true; ! if (Log_File == NULL) { printf *************** *** 169,173 **** printf ("\t\tChoose data file from menu or syntax.\n"); args_info.inputs = NULL; ! data_file_exist = false; } --- 169,173 ---- printf ("\t\tChoose data file from menu or syntax.\n"); args_info.inputs = NULL; ! Data_File_Exist = false; } *************** *** 177,181 **** ! return (0); /*This has not meaning at the moment */ } --- 177,181 ---- ! return (0); /*This has no meaning at the moment */ } *************** *** 188,200 **** { /*Handle the input file */ ! /*data_file_exist gets set */ ! data_file_exist = get_data_file (); /*read data file and close */ ! if (data_file_exist) { ! read_data_file (data_file); ! /*file_close (data_file, data_file_name); */ } } --- 188,200 ---- { /*Handle the input file */ ! /*Data_File_Exist gets set */ ! Data_File_Exist = get_data_file (); /*read data file and close */ ! if (Data_File_Exist) { ! read_data_file (Data_File); ! /*file_close (Data_File, Data_File_Name); */ } } *************** *** 217,227 **** { ! strcpy (data_file_name, *args_info.inputs); ! data_file = open_file (data_file_name, 1); ! if (data_file == NULL) { ! data_file_exist = false; printf ("\t\tInput file not found.\n\t\t\tChoose data file from menu or syntax.\n\n"); --- 217,227 ---- { ! strcpy (Data_File_Name, *args_info.inputs); ! Data_File = open_file (Data_File_Name, 1); ! if (Data_File == NULL) { ! Data_File_Exist = false; printf ("\t\tInput file not found.\n\t\t\tChoose data file from menu or syntax.\n\n"); *************** *** 229,236 **** else ! data_file_exist = true; } ! return data_file_exist; } --- 229,236 ---- else ! Data_File_Exist = true; } ! return Data_File_Exist; } *************** *** 248,252 **** /*Close log file before exit */ if (args_info.log_flag) ! file_close (logfile, logfile_name); gl = del_GetLine (gl); --- 248,252 ---- /*Close log file before exit */ if (args_info.log_flag) ! file_close (Log_File, Logfile_Name); gl = del_GetLine (gl); Index: system.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/system.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** system.h 18 Apr 2004 14:02:25 -0000 1.5 --- system.h 29 May 2004 19:59:23 -0000 1.6 *************** *** 49,56 **** * Variables */ ! bool bell; /*Determine to see if sound system bell */ ! bool double_data; ! bool log_file_flag; ! extern bool data_file_exist; #endif --- 49,55 ---- * Variables */ ! bool Bell; /*Determine to see if sound system bell */ ! bool Log_File_Flag; ! extern bool Data_File_Exist; #endif Index: menu.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/menu.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** menu.c 29 May 2004 18:22:23 -0000 1.25 --- menu.c 29 May 2004 19:59:23 -0000 1.26 *************** *** 35,40 **** #include "file_ops.h" /* For opening and closing files. */ #include "output.h" /* Calls for printing and getting stats. */ ! #include "main.h" /* gl, and flag variables (print_digit,). */ ! #include "system.h" /* Bool use. */ void do_menu_choice (int choice); --- 35,40 ---- #include "file_ops.h" /* For opening and closing files. */ #include "output.h" /* Calls for printing and getting stats. */ ! #include "main.h" /* gl, and flag variables (Print_Digit). */ ! #include "system.h" /* Bool use, Data_File_Exist. */ void do_menu_choice (int choice); *************** *** 120,125 **** /*Only 1 choice right now! */ ! print_digit = choice; ! sprintf (temp, "\n\nNumber of sig. digits is now %d\n\n", print_digit); strncat (msg, temp, strlen (temp)); printf ("%s", msg); --- 120,125 ---- /*Only 1 choice right now! */ ! Print_Digit = choice; ! sprintf (temp, "\n\nNumber of sig. digits is now %d\n\n", Print_Digit); strncat (msg, temp, strlen (temp)); printf ("%s", msg); *************** *** 128,132 **** case log_menu: ! if (log_file_flag) view_log_file (); --- 128,132 ---- case log_menu: ! if (Log_File_Flag) view_log_file (); *************** *** 159,163 **** verify = false; ! if (nrows <= 0 || columns <= 0) /* We need data and variables. */ { printf --- 159,163 ---- verify = false; ! if (Nrows <= 0 || Columns <= 0) /* We need data and variables. */ { printf *************** *** 172,176 **** while (v[i] <= -2) { ! v[i] = get_choice (choice, 1, columns); } --- 172,176 ---- while (v[i] <= -2) { ! v[i] = get_choice (choice, 1, Columns); } *************** *** 181,185 **** while (v[i - 1] >= 0) { ! v[i] = get_choice (choice, 1, columns); if (v[i] >= -1) --- 181,185 ---- while (v[i - 1] >= 0) { ! v[i] = get_choice (choice, 1, Columns); if (v[i] >= -1) *************** *** 238,245 **** /*Close open data file if necessary. */ ! if (data_file_exist) { ! file_close (data_file, data_file_name); ! data_file_exist = false; } --- 238,245 ---- /*Close open data file if necessary. */ ! if (Data_File_Exist) { ! file_close (Data_File, Data_File_Name); ! Data_File_Exist = false; } *************** *** 249,257 **** -1); ! strcpy (data_file_name, temp); /*Determine if user just hit Enter. */ ! if (strlen (data_file_name) <= 1) ! data_file_exist = 0; /*we have a file name, now see if it is there. */ --- 249,257 ---- -1); ! strcpy (Data_File_Name, temp); /*Determine if user just hit Enter. */ ! if (strlen (Data_File_Name) <= 1) ! Data_File_Exist = 0; /*we have a file name, now see if it is there. */ *************** *** 259,275 **** { ! data_file_name[strlen (data_file_name) - 1] = '\0'; ! data_file = open_file (data_file_name, 1); /*Check to see if opened file. */ ! if (data_file == NULL) { ! data_file_exist = false; ! printf ("%s not found!\n", data_file_name); } /*We have a valid file and it is opened! */ else ! data_file_exist = true; } --- 259,275 ---- { ! Data_File_Name[strlen (Data_File_Name) - 1] = '\0'; ! Data_File = open_file (Data_File_Name, 1); /*Check to see if opened file. */ ! if (Data_File == NULL) { ! Data_File_Exist = false; ! printf ("%s not found!\n", Data_File_Name); } /*We have a valid file and it is opened! */ else ! Data_File_Exist = true; } *************** *** 279,283 **** { printf ("Reading the data file\n\n"); ! read_data_file (data_file); } --- 279,283 ---- { printf ("Reading the data file\n\n"); ! read_data_file (Data_File); } |
|
From: Mike H. B. <bik...@us...> - 2004-05-29 19:59:32
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30640 Modified Files: ChangeLog Log Message: Variable name cleanup. Added multiple vars for sorted stats in statistics.c. Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ChangeLog 29 May 2004 18:22:21 -0000 1.22 --- ChangeLog 29 May 2004 19:59:22 -0000 1.23 *************** *** 1,3 **** --- 1,5 ---- 2004-05-30 Mike H. Benton (bik...@us...) + *src: Clean up of variable names. A style thing, and removed extras. + *src/menu.c (do_stats_choice): Added an error check for no data. (menu_main): Added void to declaration. |
|
From: Mike H. B. <bik...@us...> - 2004-05-29 18:22:37
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14891/src Modified Files: cmdline.c error.c error.h file_ops.c file_ops.h main.c main.h menu.c menu.h output.c statistics.c statistics.h Log Message: Added ability to read files that have float and int or just one. Not 100% on printing variable number. Some cleanup of function calls, and other housekeeping. Index: file_ops.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** file_ops.h 30 Mar 2004 15:49:48 -0000 1.9 --- file_ops.h 29 May 2004 18:22:23 -0000 1.10 *************** *** 31,34 **** --- 31,38 ---- #define MAXROWS 131073 #define MAXCOLS 400 /*Current limit of max. data file cols (variables) */ + /* Defines used for Data_Type. */ + #define INT_DATA 1 + #define FLOAT_DATA 2 + #define CHAR_DATA 3 /* *************** *** 41,47 **** int getwords (char *line, char *words[], int maxwords); int fgetline (FILE * fp, char line[], int max); ! void view_log_file (); void update_logfile (char *message); ! int getit (FILE * file_name, int element, int t[]); /* --- 45,51 ---- int getwords (char *line, char *words[], int maxwords); int fgetline (FILE * fp, char line[], int max); ! void view_log_file (void); void update_logfile (char *message); ! int getit (FILE * file_name, int element, long double t[]); /* *************** *** 50,53 **** --- 54,62 ---- extern int nrows; /*number of rows in data file */ extern int columns; /*number of columns in a data file */ + /* + * Data_Type is an array containing the type of data for each respective variable. + * 1 is int, 2 is float, 3 is character. + */ + extern int Data_Type[]; #endif Index: error.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/error.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** error.h 30 Mar 2004 15:49:48 -0000 1.6 --- error.h 29 May 2004 18:22:23 -0000 1.7 *************** *** 26,30 **** * Prototypes */ ! void set_signals (); void signal_abrt (int sig_value); void signal_fpe (int sig_value); --- 26,30 ---- * Prototypes */ ! void set_signals (void); void signal_abrt (int sig_value); void signal_fpe (int sig_value); Index: file_ops.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** file_ops.c 30 Mar 2004 15:49:48 -0000 1.10 --- file_ops.c 29 May 2004 18:22:23 -0000 1.11 *************** *** 1,20 **** ! /* File operatins for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton ! Mike H. Benton <bik...@us...>, 2003. ! 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. */ --- 1,20 ---- ! /* File operations for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton ! Mike H. Benton <bik...@us...>, 2003. ! 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. */ *************** *** 24,28 **** #include <stdio.h> #include <stdlib.h> ! #include <ctype.h> #include <string.h> --- 24,28 ---- #include <stdio.h> #include <stdlib.h> ! #include <ctype.h> /* Conversions and class testing. */ #include <string.h> *************** *** 34,37 **** --- 34,39 ---- int nrows; /*The number of rows in the data file */ int columns; /*The number of columns in the data file */ + int Data_Type[MAXCOLS]; /* The type of data for each variable. */ + void printline (FILE * fp); *************** *** 45,56 **** if (fclose (fp) == 0) ! printf ("\t\t%s closed succesfully!\n", file_name); else printf ("\t\t%s did not close\n", file_name); - return; - - } --- 47,55 ---- if (fclose (fp) == 0) ! printf ("\t\t%s closed successfully!\n", file_name); else printf ("\t\t%s did not close\n", file_name); } *************** *** 58,62 **** * Opens file_name as a file. * Returns a file pointer. ! * need to add type of flag input */ FILE * --- 57,61 ---- * Opens file_name as a file. * Returns a file pointer. ! * FIXME: need to add type of flag input */ FILE * *************** *** 74,77 **** --- 73,82 ---- fp = fopen (file_name, "w+"); + else + { + printf ("ERROR: invalid open_mode in open_file!\n"); + exit (EXIT_FAILURE); + } + if (fp == NULL) fprintf (stderr, "\t\tCannot open %s!\n\t\tERROR: %s!\n", file_name, *************** *** 82,101 **** return fp; } /* * Returns void. ! * Just count rows, and columns for now. ! * Add file type (tab or , delimiting, tab default). ! * Add variable label. ! * Add auto input type, now just numbers. * Calls fgetline () and getwords(). ! * Need to set blank to missing. ! * Need to define missing! ! * Reads data that is not there, as above ! * Reads . as a line!!!!! */ - - /*needs lots o work*/ void read_data_file (FILE * file_name) --- 87,101 ---- return fp; + } /* * Returns void. ! * Counts the number of cases, and sets VARIABLE_TYPE. * Calls fgetline () and getwords(). ! * ! * FIXME: Need to set blank to missing. Need to define missing! Reads data that is not there, as above ! * FIXME: Reads . as a line!!!!! */ void read_data_file (FILE * file_name) *************** *** 115,119 **** "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", strerror (errno)); ! exit (EXIT_FAILURE); } --- 115,119 ---- "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", strerror (errno)); ! nrows = columns = -1; /* Set to -1 for error checks elsewhere. */ } *************** *** 139,145 **** --- 139,147 ---- } } + printf ("\nThere are %d rows (cases)\n\tand %d columns (variables) in the data set\n", nrows, columns); + } *************** *** 154,181 **** { char *p = line; ! int nwords = 0; while (1) { while (isspace (*p)) p++; if (*p == '\0') return nwords; words[nwords++] = p; while (!isspace (*p) && *p != '\0') ! p++; if (*p == '\0') return nwords; ! *p++ = '\0'; ! if (nwords >= maxwords) return nwords; } } --- 156,246 ---- { + bool is_int, is_float, is_char; char *p = line; ! int nwords, testing, location; ! ! nwords = 0; + /* Infinite. Break within. */ while (1) { + /* Set to false for first run of word. */ + is_int = is_float = is_char = false; + + /* If a space, go until not. */ while (isspace (*p)) p++; + /* If end of line, go home with results. */ if (*p == '\0') return nwords; + location = nwords; words[nwords++] = p; + /* + * Cycle through until end or separator. + * Test to determine type of data. + */ while (!isspace (*p) && *p != '\0') ! { ! testing = isdigit (*p); ! ! if (is_int == true && *p == '.' && is_float == false) ! { ! is_float = true; ! is_int = false; ! } ! ! else if (is_float == false && is_int == false && is_char == false ! && testing != 0) ! { ! is_int = true; ! } + else if (is_float == false && is_char == false && *p == '.') + is_float = true; + + else if (testing == 0) + { + is_char = true; + is_int = false; + is_float = false; + } + + p++; + + } + + /* Set the Data_Type. */ + if (is_float == true && Data_Type[location] != CHAR_DATA) + { + Data_Type[location] = FLOAT_DATA; + } + + if (is_int == true + && (Data_Type[location] != CHAR_DATA + || Data_Type[location] != FLOAT_DATA)) + { + Data_Type[location] = INT_DATA; + } + + if (is_char == true) + { + Data_Type[location] = CHAR_DATA; + } + + /* If end, go back. */ if (*p == '\0') return nwords; ! /* Need and error here. */ if (nwords >= maxwords) return nwords; + + /*We need to go back look at next word. */ + p++; } + } *************** *** 214,217 **** --- 279,283 ---- line[nch] = '\0'; return nch; + } *************** *** 223,227 **** void ! view_log_file () { --- 289,293 ---- void ! view_log_file (void) { *************** *** 233,237 **** /* ! * Currenly print a file. */ --- 299,303 ---- /* ! * Currently print a file. */ *************** *** 244,248 **** printf ("%s", s); - } --- 310,313 ---- *************** *** 284,288 **** int ! getit (FILE * file_name, int element, int t[]) { static FILE *temp_fp; /*used for passing between read functions */ --- 349,353 ---- int ! getit (FILE * file_name, int element, long double t[]) { static FILE *temp_fp; /*used for passing between read functions */ *************** *** 332,334 **** --- 397,400 ---- return 1; + } Index: error.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/error.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** error.c 17 May 2004 17:22:20 -0000 1.8 --- error.c 29 May 2004 18:22:23 -0000 1.9 *************** *** 33,37 **** void ! set_signals () { signal (SIGABRT, signal_abrt); --- 33,37 ---- void ! set_signals (void) { signal (SIGABRT, signal_abrt); Index: cmdline.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/cmdline.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** cmdline.c 25 Apr 2004 22:30:43 -0000 1.7 --- cmdline.c 29 May 2004 18:22:23 -0000 1.8 *************** *** 94,98 **** { ! int i; for (i = 0; i < args_info->inputs_num; ++i) --- 94,98 ---- { ! unsigned i; for (i = 0; i < args_info->inputs_num; ++i) Index: statistics.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** statistics.c 22 May 2004 06:33:02 -0000 1.31 --- statistics.c 29 May 2004 18:22:23 -0000 1.32 *************** *** 34,38 **** #include "error.h" /*Calls to error routines (so called custom). */ ! #include "file_ops.h" /*Calls to data file for matrix or vector building. */ #include "statistics.h" --- 34,38 ---- #include "error.h" /*Calls to error routines (so called custom). */ ! #include "file_ops.h" /*Calls to data file for matrix or vector building, and Data_Type. */ #include "statistics.h" *************** *** 47,51 **** bool make_vector (int row); /* Create vector of variable row. */ ! bool make_matrix (int x[]); /* Create matrix of variables stored in x. */ /* --- 47,51 ---- bool make_vector (int row); /* Create vector of variable row. */ ! bool make_matrix (int x[], bool type, int how_much); /* Create matrix of variables stored in x. */ /* *************** *** 55,63 **** */ bool ! stats_main (int x[], bool vector) { int variable; /* Only used in vector. */ bool verified; /* Status of making vector or matrix. */ ! verified = false; /* Set as false, called proceures will change to true if succesful. */ if (vector) /* Make a vector. */ --- 55,63 ---- */ bool ! stats_main (int x[], bool vector, bool type, int how_much) { int variable; /* Only used in vector. */ bool verified; /* Status of making vector or matrix. */ ! verified = false; /* Set as false, called proceures will change to true if succesful. */ if (vector) /* Make a vector. */ *************** *** 69,73 **** else /* Make a matrix. */ { ! verified = make_matrix (x); } --- 69,73 ---- else /* Make a matrix. */ { ! verified = make_matrix (x, type, how_much); } *************** *** 86,121 **** */ bool ! get_mean (bool is_vector, int index, long double results[]) { int sum; if (is_vector) /*Just get moments for one variable. */ { - results[0] = mean_int_vector (vta, index, nrows, &sum); - results[1] = var_int_vector (vta, &results[0], index, nrows); - results[2] = skewness_int_vector (vta, &results[1], &results[0], nrows); - results[3] = kurtosis_int_vector (vta, &results[1], &results[0], nrows); } else /*Get moments from matrix. */ { ! results[0] = mean_int_matrix (mta, index, nrows, &sum); ! results[1] = var_int_matrix (mta, &results[0], index, nrows); ! results[2] = skewness_int_matrix (mta, index, &results[1], &results[0], nrows); ! results[3] = kurtosis_int_matrix (mta, index, &results[1], &results[0], nrows); ! } ! results[4] = sum; ! return true; } /* ! * Sorted type statistics and tails. ! */ bool ! get_sorted_stats (bool is_vector, int index, long double results[]) { if (is_vector) /*Process vector data. */ --- 86,173 ---- */ bool ! get_mean (bool is_vector, int for_type, int index, long double results[]) { int sum; + long double ld_sum; if (is_vector) /*Just get moments for one variable. */ { + if (Data_Type[for_type] == INT_DATA) + { + results[0] = mean_int_vector (vta, index, nrows, &sum); + results[1] = var_int_vector (vta, &results[0], index, nrows); + results[2] = + skewness_int_vector (vta, &results[1], &results[0], nrows); + results[3] = + kurtosis_int_vector (vta, &results[1], &results[0], nrows); + results[4] = sum; + results[1] = sqrt (results[1]); + } + + else if (Data_Type[for_type] == FLOAT_DATA) + { + results[0] = mean_ld_vector (vldta, index, nrows, &ld_sum); + results[1] = var_ld_vector (vldta, &results[0], index, nrows); + results[2] = + skewness_ld_vector (vldta, &results[1], &results[0], nrows); + results[3] = + kurtosis_ld_vector (vldta, &results[1], &results[0], nrows); + results[4] = ld_sum; + results[1] = sqrt (results[1]); + } + + else + { + printf ("ERROR: wrong data type for vector in get_mean.\n"); + return false; + } } else /*Get moments from matrix. */ { ! if (Data_Type[for_type] == INT_DATA) ! { ! results[0] = mean_int_matrix (mta, index, nrows, &sum); ! results[1] = var_int_matrix (mta, &results[0], index, nrows); ! results[2] = ! skewness_int_matrix (mta, index, &results[1], &results[0], nrows); ! results[3] = ! kurtosis_int_matrix (mta, index, &results[1], &results[0], nrows); ! results[4] = sum; ! results[1] = sqrt (results[1]); ! } ! else if (Data_Type[for_type] == FLOAT_DATA) ! { ! results[0] = mean_ld_matrix (mldta, index, nrows, &ld_sum); ! results[1] = var_ld_matrix (mldta, &results[0], index, nrows); ! results[2] = ! skewness_ld_matrix (mldta, index, &results[1], &results[0], ! nrows); ! results[3] = ! kurtosis_ld_matrix (mldta, index, &results[1], &results[0], ! nrows); ! results[4] = ld_sum; ! results[1] = sqrt (results[1]); ! } ! else ! { ! printf ("ERROR: wrong data type for matrix in get_mean.\n"); ! return false; ! } ! } ! ! return true; } /* ! * Sorted type statistics and tails. ! */ bool ! get_sorted_stats (bool is_vector, int for_type, int index, ! long double results[]) { if (is_vector) /*Process vector data. */ *************** *** 125,129 **** q_sort_int_vector (vta, 1, nrows); results[7] = median_int_vector (vta, nrows); ! quartiles_int_vector (vta, nrows, &results[8], &results[9]); } --- 177,181 ---- q_sort_int_vector (vta, 1, nrows); results[7] = median_int_vector (vta, nrows); ! quartiles_int_vector (vta, nrows, &results[8], &results[9]); } *************** *** 145,175 **** /* ! ** Fill up vector for analysis. ! ** Use var_column is for the particular variable. ! ** Returns false if not enough calloc fails. ! */ bool make_vector (int var_column) { int i; ! int t[MAXROWS]; ! i = 0; ! vta = vector_int_calloc (nrows); ! if (vta == NULL) { ! printf ! ("Cannot allocate memory in make_vector\n Free memory, reboot, or report file size in a bug report.\n"); ! return false; } ! /*Fill t with data. */ getit (data_file, var_column, t); /*Put t into a vector. */ while (i < nrows) { ! vector_int_set (vta, i, t[i]); i++; } --- 197,258 ---- /* ! ** Fill up vector for analysis. ! ** Use var_column is for the particular variable. ! ** Returns false if not enough calloc fails. ! */ bool make_vector (int var_column) { int i; ! long double t[MAXROWS]; ! i = 0; ! if (Data_Type[var_column] == INT_DATA) { ! vta = vector_int_calloc (nrows); ! ! if (vta == NULL) ! { ! printf ! ("Cannot allocate memory in make_vector\n Free memory, reboot, or report file size in a bug report.\n"); ! return false; ! } } ! else if (Data_Type[var_column] == FLOAT_DATA) ! { ! vldta = vector_ld_calloc (nrows); ! ! if (vldta == NULL) ! { ! printf ! ("Cannot allocate memory in make_vector\n Free memory, reboot, or report file size in a bug report.\n"); ! return false; ! } ! } ! ! else ! { ! printf ("ERROR: unknown data type in make_vector!\n"); ! exit (EXIT_FAILURE); ! } ! ! /*Fill t with data. */ getit (data_file, var_column, t); /*Put t into a vector. */ + while (i < nrows) { ! if (Data_Type[var_column] == INT_DATA) ! vector_int_set (vta, i, t[i]); ! else if (Data_Type[var_column] == FLOAT_DATA) ! vector_ld_set (vldta, i, t[i]); ! else ! { ! printf ("ERROR: unknown data type in make_vector!\n"); ! exit (EXIT_FAILURE); ! } i++; } *************** *** 180,203 **** bool ! make_matrix (int x[]) { int i, c, temp; ! int t[MAXROWS]; ! i = 1; /*Allocate matrix */ ! mta = matrix_int_calloc (nrows, NUM_VARS); ! if (mta == NULL) { ! printf ! ("Cannot allocate memory in make_matrix\n Free memory, reboot, or report file size in a bug report.\n"); ! return false; } /*Read data into matrix */ ! while (i <= NUM_VARS) { ! temp = x[i - 1]; getit (data_file, temp, t); --- 263,303 ---- bool ! make_matrix (int x[], bool type, int how_much) { int i, c, temp; ! long double t[MAXROWS]; ! i = 0; /*Allocate matrix */ ! ! if (type == true) { ! mta = matrix_int_calloc (nrows, how_much); ! ! if (mta == NULL) ! { ! printf ! ("Cannot allocate memory in make_vector\n Free memory, reboot, or report file size in a bug report.\n"); ! return false; ! } ! } ! ! else ! { ! mldta = matrix_ld_calloc (nrows, how_much); ! ! if (mldta == NULL) ! { ! printf ! ("Cannot allocate memory in make_vector\n Free memory, reboot, or report file size in a bug report.\n"); ! return false; ! } } /*Read data into matrix */ ! while (i < how_much) { ! temp = x[i]; getit (data_file, temp, t); *************** *** 206,210 **** while (c < nrows) { ! matrix_int_set (mta, c, i - 1, t[c]); c++; } --- 306,316 ---- while (c < nrows) { ! if (type == true) ! matrix_int_set (mta, c, i, t[c]); ! ! else ! matrix_ld_set (mldta, c, i, t[c]); ! ! c++; } *************** *** 224,239 **** free_data (int what_to_free) { ! assert (what_to_free >= 0 && what_to_free <= 3); ! if (what_to_free == 0) vector_int_free (vta); ! else if (what_to_free == 1) matrix_int_free (mta); ! else if (what_to_free == 2) vector_ld_free (vldta); ! else if (what_to_free == 3) matrix_ld_free (mldta); else ! printf ("NOT a valid what_to_free!\n"); } --- 330,345 ---- free_data (int what_to_free) { ! assert (what_to_free >= 0 && what_to_free <= 3); ! if (what_to_free == FREE_VECTOR_INT) vector_int_free (vta); ! else if (what_to_free == FREE_MATRIX_INT) matrix_int_free (mta); ! else if (what_to_free == FREE_VECTOR_LD) vector_ld_free (vldta); ! else if (what_to_free == FREE_MATRIX_LD) matrix_ld_free (mldta); else ! printf ("NOT a valid what_to_free!\n"); } Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** output.c 22 May 2004 06:33:02 -0000 1.27 --- output.c 29 May 2004 18:22:23 -0000 1.28 *************** *** 31,43 **** #include <string.h> /* Various uses of string functions. */ #include <assert.h> /* The error checks. */ ! #include <math.h> /* The log function is used in desc to determine v lenght. */ ! /*Use -ltecla for linking*/ - #include <libtecla.h> /* Use for input. */ #include "output.h" #include "statistics.h" /* Calls to statistical routines. */ #include "main.h" /* Flag variables (print_digits). */ ! #include "menu.h" /* Enumeration values. */ #include "file_ops.h" /* Sending data to the logfile. */ /* --- 31,52 ---- #include <string.h> /* Various uses of string functions. */ #include <assert.h> /* The error checks. */ ! #include <math.h> /* The log function is used in desc to determine v length. */ ! ! ! #include "output.h" #include "statistics.h" /* Calls to statistical routines. */ #include "main.h" /* Flag variables (print_digits). */ ! #include "menu.h" /* Enumeration values, and MAX_VAR_INPUT. */ #include "file_ops.h" /* Sending data to the logfile. */ + #include "system.h" /* Bool and config.h calls. */ + + /*FIXME: Need alternate for MSDOS or w/o libtecla. */ + #ifndef MSDOS + #ifdef HAVE_LIBTECLA + #include <libtecla.h> /* Use for input. Use -ltecla for linking. */ + #endif /* #elif include"myinput.h" */ + #endif /* *************** *** 47,82 **** int NUM_VARS; /* Number of variables for analysis. */ extern GetLine *gl; /* The getline variable for libtecla. */ /* * Functions */ ! void desc (bool vector_flag, bool all_stats, int v[]); /* Print descriptive tables. */ void format_output (char *input, double value); /* Adjust for number of sig digits. */ bool output_main (int v[], int routine, int stats_to_do) { bool verify; ! int i; assert (routine >= 100 && routine <= 103); ! FLAG_VECTOR = true; ! NUM_VARS = 0; ! /*Double check to make sure we have something. */ i = 0; if (v[i] == -1) return true; ! /*See if we have one, or more than one variable. */ while (v[i] >= 0) { i++; NUM_VARS++; } ! /*Lets make a vector or matrix. */ ! if (NUM_VARS == 1) { ! verify = stats_main (v, true); if (verify == false) --- 56,117 ---- int NUM_VARS; /* Number of variables for analysis. */ extern GetLine *gl; /* The getline variable for libtecla. */ + int count_int, count_ld; /* Counts of respective types for making a matrix. */ + /* * Functions */ ! bool desc (bool all_stats, int v[], int matrix_int_vars[], int matrix_ld_vars[]); /* Print descriptive tables. */ void format_output (char *input, double value); /* Adjust for number of sig digits. */ + void free_which_data (int v[]); /* Frees up the build vector/matrix. */ + /*FIXME: break this up a bit. */ bool output_main (int v[], int routine, int stats_to_do) { bool verify; ! int i, ct_int[MAX_VAR_INPUT], ct_ld[MAX_VAR_INPUT]; ! assert (routine >= 100 && routine <= 103); ! FLAG_VECTOR = true; /* Default is just true because most people will just look at one variable:D */ ! NUM_VARS = count_int = count_ld = 0; ! /* FIXME: do something with stats_to_do! */ ! i = stats_to_do; ! ! /* Double check to make sure we have something. */ i = 0; if (v[i] == -1) return true; ! /* ! * See if we have one, or more than one variable. ! * Also, setups number of variable types. ! * An alternate to v is made for printing variable names. This is to accomdated for different types. ! * Basically, and index for cross-reference will be made for makeing output. ! */ while (v[i] >= 0) { + if (Data_Type[v[i]] == INT_DATA) + { + ct_int[count_int] = v[i]; + count_int++; + } + else if (Data_Type[v[i]] == FLOAT_DATA) + { + ct_ld[count_ld] = v[i]; + count_ld++; + } + i++; NUM_VARS++; } ! ct_int[count_int] = ct_ld[count_ld] = -1; /* Last value set to -1 for checks. */ ! ! /* Lets make a vector or matrix. */ ! if (NUM_VARS == 1) /* Vector is simple! Just up and go. */ { ! verify = stats_main (v, true, true, count_int); if (verify == false) *************** *** 87,100 **** } ! else { FLAG_VECTOR = false; - verify = stats_main (v, false); ! if (verify == false) { ! printf ("ERROR: Failed to make a matrix!\n\n"); ! return false; } } --- 122,149 ---- } ! else /* A bit complicated (too complicated?). But, make relevant matrix/vectors. */ { FLAG_VECTOR = false; ! if (count_int >= 1) { ! verify = stats_main (ct_int, false, true, count_int); ! if (verify == false) ! { ! printf ("ERROR: Failed to make a matrix!\n\n"); ! return false; ! } } + + if (count_ld >= 1) + { + verify = stats_main (ct_ld, false, false, count_ld); + if (verify == false) + { + printf ("ERROR: Failed to make a matrix!\n\n"); + return false; + } + } + } *************** *** 103,111 **** { case descriptives: ! desc (FLAG_VECTOR, false, v); break; case more_descriptives: ! desc (FLAG_VECTOR, true, v); break; --- 152,160 ---- { case descriptives: ! verify = desc (false, v, ct_int, ct_ld); break; case more_descriptives: ! verify = desc (true, v, ct_int, ct_ld); break; *************** *** 115,134 **** } ! /*Clear matrix or vector. */ ! if (FLAG_VECTOR) ! free_data (0); ! else ! free_data (1); return true; } ! void ! desc (bool is_vector, bool all_stats, int v[]) { bool stat_test; char results_col[11][MROW]; char *p_output; ! int i, im, output_size, stop_me; long double results[11]; size_t j, k; --- 164,180 ---- } ! /* All finished so free up the matrix/vector. */ ! free_which_data (v); return true; } ! bool ! desc (bool all_stats, int v[], int matrix_int_vars[], int matrix_ld_vars[]) { bool stat_test; char results_col[11][MROW]; char *p_output; ! int i, im, output_size, stop_me, offset, num_int, num_ld; long double results[11]; size_t j, k; *************** *** 139,143 **** char stats_label[11][20] = { {"Mean\t\t"}, ! {"Variance\t"}, {"Skewness\t"}, {"Kurtosis\t"}, --- 185,189 ---- char stats_label[11][20] = { {"Mean\t\t"}, ! {"SD\t\t"}, {"Skewness\t"}, {"Kurtosis\t"}, *************** *** 150,154 **** {"IQR\t\t"} }; ! char table_header[] = "\nDescriptive Statistis for"; char table_subheader[] = "Statistics\tValue\n"; stop_me = 4; /* That is, only do until Sum. */ --- 196,200 ---- {"IQR\t\t"} }; ! char table_header[] = "\nDescriptive Statistics for"; char table_subheader[] = "Statistics\tValue\n"; stop_me = 4; /* That is, only do until Sum. */ *************** *** 158,161 **** --- 204,208 ---- /* Populate the first row with title. */ output_size = sizeof (table_header); + num_int = num_ld = offset = 0; /* *************** *** 165,183 **** { /* Get the stats. */ ! stat_test = get_mean (is_vector, im, results); ! if (stat_test == false) ! break; ! ! if (all_stats == true) { ! stat_test = get_sorted_stats (is_vector, im, results); if (stat_test == false) ! break; ! stop_me = 10; } /* Lets get the title in. Determing how big the variable name is! */ /* Pad for log, space, and \n. */ ! output_size += sizeof (table_subheader) + log (v[im] + 1) + 3; /* --- 212,279 ---- { /* Get the stats. */ ! if (FLAG_VECTOR) /* Vector for analysis. */ { ! stat_test = get_mean (FLAG_VECTOR, im, im, results); if (stat_test == false) ! return false; ! ! if (all_stats == true) ! { ! stat_test = get_sorted_stats (FLAG_VECTOR, im, im, results); ! if (stat_test == false) ! return false; ! stop_me = 10; ! } ! ! offset = im; ! } ! ! else /* We have a matrix! Off to fun land! */ ! { ! if (num_ld < count_ld) ! { ! stat_test = get_mean (FLAG_VECTOR, matrix_ld_vars[num_ld], num_ld, results); ! if (stat_test == false) ! return false; ! if (all_stats == true) ! { ! stat_test = ! get_sorted_stats (FLAG_VECTOR, matrix_ld_vars[num_ld], num_ld, results); ! ! if (stat_test == false) ! return false; ! ! stop_me = 10; ! } ! ! offset = matrix_ld_vars[num_ld]; ! num_ld++; ! } ! ! else if (num_int < count_int) ! { ! stat_test = get_mean (FLAG_VECTOR, matrix_int_vars[num_int], num_int, results); ! if (stat_test == false) ! return false; ! ! if (all_stats == true) ! { ! stat_test = ! get_sorted_stats (FLAG_VECTOR, matrix_int_vars[num_int], num_int, results); ! ! if (stat_test == false) ! return false; ! ! stop_me = 10; ! } ! ! offset = matrix_int_vars[num_int]; ! num_int++; ! } } /* Lets get the title in. Determing how big the variable name is! */ /* Pad for log, space, and \n. */ ! output_size += sizeof (table_subheader) + log (offset + 1) + 3; /* *************** *** 222,225 **** --- 318,322 ---- } + return true; } *************** *** 275,278 **** --- 372,406 ---- } + /*Clear matrix or vector. */ + void + free_which_data (int v[]) + { + int i; + if (FLAG_VECTOR) + { + i = v[0]; + if (Data_Type[i] == INT_DATA) + free_data (FREE_VECTOR_INT); + else if (Data_Type[i] == FLOAT_DATA) + free_data (FREE_VECTOR_LD); + else + { + printf ("ERROR: bad what to free in output_main for vector.\n"); + exit (EXIT_FAILURE); + } + + } + + else + { + if (count_int >= 1) + free_data (FREE_MATRIX_INT); + + if (count_ld >= 1) + free_data (FREE_MATRIX_LD); + + } + } + /*Main output structure Index: menu.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/menu.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** menu.h 15 Mar 2004 15:07:26 -0000 1.11 --- menu.h 29 May 2004 18:22:23 -0000 1.12 *************** *** 46,50 **** * Prototypes */ ! void menu_main (); /*FIXME: move?*/ void do_file_menu (int not_read); --- 46,50 ---- * Prototypes */ ! void menu_main (void); /*FIXME: move?*/ void do_file_menu (int not_read); Index: main.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** main.h 5 May 2004 08:05:43 -0000 1.10 --- main.h 29 May 2004 18:22:23 -0000 1.11 *************** *** 33,37 **** * Prototypes */ ! void exit_mistat (); /* --- 33,37 ---- * Prototypes */ ! void exit_mistat (void); /* Index: statistics.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** statistics.h 9 May 2004 15:06:33 -0000 1.18 --- statistics.h 29 May 2004 18:22:23 -0000 1.19 *************** *** 1,17 **** /* Header for statistics.c in mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* Header for statistics.c in mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 23,27 **** #define STATS_H ! #include "system.h" /* For bool. */ /* --- 23,32 ---- #define STATS_H ! #include "system.h" /* For bool. */ ! ! #define FREE_VECTOR_INT 0 ! #define FREE_VECTOR_LD 1 ! #define FREE_MATRIX_INT 2 ! #define FREE_MATRIX_LD 3 /* *************** *** 35,41 **** */ ! bool stats_main (int x[], bool is_vector); ! bool get_mean (bool is_vector, int index, long double results []); ! bool get_sorted_stats (bool is_vector, int index, long double results []); void free_data (int what_to_free); --- 40,48 ---- */ ! bool stats_main (int x[], bool is_vector, bool type, int how_much); ! bool get_mean (bool is_vector, int for_type, int index, ! long double results[]); ! bool get_sorted_stats (bool is_vector, int for_type, int index, ! long double results[]); void free_data (int what_to_free); Index: main.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** main.c 9 May 2004 15:06:33 -0000 1.13 --- main.c 29 May 2004 18:22:23 -0000 1.14 *************** *** 1,17 **** /* Entry point for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* Entry point for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 55,60 **** */ int do_args (int argc, char **argv); ! bool get_data_file (int num); ! void process_data_file (int argc, char **argv); --- 55,60 ---- */ int do_args (int argc, char **argv); ! bool get_data_file (void); ! void process_data_file (void); *************** *** 173,177 **** else ! process_data_file (argc, argv); --- 173,177 ---- else ! process_data_file (); *************** *** 185,194 **** */ void ! process_data_file (int argc, char **argv) { /*Handle the input file */ /*data_file_exist gets set */ ! data_file_exist = get_data_file (1); /*read data file and close */ --- 185,194 ---- */ void ! process_data_file (void) { /*Handle the input file */ /*data_file_exist gets set */ ! data_file_exist = get_data_file (); /*read data file and close */ *************** *** 206,210 **** */ bool ! get_data_file (int num) { --- 206,210 ---- */ bool ! get_data_file (void) { *************** *** 242,246 **** */ void ! exit_mistat () { printf ("\n\n\t\tExiting mistat\n"); --- 242,246 ---- */ void ! exit_mistat (void) { printf ("\n\n\t\tExiting mistat\n"); Index: menu.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/menu.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** menu.c 22 May 2004 06:33:02 -0000 1.24 --- menu.c 29 May 2004 18:22:23 -0000 1.25 *************** *** 57,61 **** void ! menu_main () { int choice; --- 57,61 ---- void ! menu_main (void) { int choice; *************** *** 143,146 **** --- 143,147 ---- free (msg); + } *************** *** 150,154 **** void ! do_stats_choice (choice) { int v[MAX_VAR_INPUT]; --- 151,155 ---- void ! do_stats_choice (int choice) { int v[MAX_VAR_INPUT]; *************** *** 156,159 **** --- 157,169 ---- int i; + verify = false; + + if (nrows <= 0 || columns <= 0) /* We need data and variables. */ + { + printf + ("No data or cases are avilable for analysis.\nOpen a new data file!\n"); + return; + } + /* Get the variables for input. */ i = 0; |
|
From: Mike H. B. <bik...@us...> - 2004-05-29 18:22:33
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14891 Modified Files: ChangeLog Log Message: Added ability to read files that have float and int or just one. Not 100% on printing variable number. Some cleanup of function calls, and other housekeeping. Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ChangeLog 22 May 2004 06:33:02 -0000 1.21 --- ChangeLog 29 May 2004 18:22:21 -0000 1.22 *************** *** 1,48 **** 2004-05-22 Mike H. Benton (bik...@us...) ! *src/menu.c (do_stas_choice): Clean up. ! (get_choice): Support clean up. ! ! *src/output.c (desc): Support of basic or advanced descriptive statistics. ! ! #src/statistics.c (free_data): Added assert calls. ! Added #include <assert.h> 2004-05-21 Mike H. Benton (bik...@us...) ! *src/output.c: Continued work on output. The basic method is there! ! *src/output.h: Changed call to output_main. ! *src/menu.c: Support change in call to output_main. 2004-05-18 Mike H. Benton (bik...@us...) ! *src/error.c (my_gsl_error_check): Removed as not using gsl. ! ! *src/output.c: Continue work on output. About there for basic method. 2004-05-09 Mike H. Benton (bik...@us...) ! *ChangeLog: Fixed a few datas (04's were 05's) ! ! *src/main.c (main): Housekeeping (return(0) to just return 0); ! ! *src/menu.c (do_menu_choice): Re-implement ability to change sig digits. ! Housekeeping. ! ! *src/ouput.c: Continue work on output. ! *src/statistics.c: Remove structure, and change functions calls. ! *src/statistics.h: Remove structures. ! 2004-05-05 Mike H. Benton (bik...@us...) ! *src/main.c: Fixed problem with the loss of data_file_name. ! (get_data_file): Update. ! Did some housekeeping. ! *src/main.h: Added MAXFILENAME. ! *src/menu.c (do_file_menu): Update. ! ! 2004-04-26 Mike H. Benton (bik...@us...) ! *src/cmdline.c ! *src/cmdline.h: Updated using gengetopt version 2.12.1. --- 1,78 ---- + 2004-05-30 Mike H. Benton (bik...@us...) + *src/menu.c (do_stats_choice): Added an error check for no data. + (menu_main): Added void to declaration. + *src/menu.h: Support changes to menu.c + *src/main.c: Removed so unused declarations, added voids where needed. + *src/main.h: Support changes in main.c. + *src/error.c + *src/error.h: Added void to a fuction call. + + *src/cmdline.c (cmdline_parser_free): Changed i to unsigned. + + *src/file_ops.c (open_file): Added additional error check. + (read_data_file): For no data file, exit. + (get_words): Overhaul to support multiple data types. + (getit): Support multiple data types. + Added a few voids in functions and comment cleanup. + *src/file_ops.h: Support changes for multiple data types. + *src/output.c: Overhaul most functions to support multiple data types. + *src/statistics.c: Overhaul of all functions. + *src/statistics.h: Added defines and updated declarations to support + changes in statistics.c. + + + 2004-05-30 Mike H. Benton (bik...@us...) + *src/statistics.c (stats_main): Added use of type and how_much; and + update call to make_matrix. + *src/statistics.h: Added defines and updated declarations to support + changes in statistics.c. + 2004-05-22 Mike H. Benton (bik...@us...) ! *src/menu.c (do_stas_choice): Clean up. ! (get_choice): Support clean up. ! ! *src/output.c (desc): Support of basic or advanced descriptive ! statistics. ! ! #src/statistics.c (free_data): Added assert calls. ! Added #include <assert.h> 2004-05-21 Mike H. Benton (bik...@us...) ! *src/output.c: Continued work on output. The basic method is there! ! *src/output.h: Changed call to output_main. ! *src/menu.c: Support change in call to output_main. 2004-05-18 Mike H. Benton (bik...@us...) ! *src/error.c (my_gsl_error_check): Removed as not using gsl. ! ! *src/output.c: Continue work on output. About there for basic method. 2004-05-09 Mike H. Benton (bik...@us...) ! *ChangeLog: Fixed a few datas (04's were 05's) ! ! *src/main.c (main): Housekeeping (return(0) to just return 0); ! ! *src/menu.c (do_menu_choice): Re-implement ability to change sig digits. ! Housekeeping. ! ! *src/ouput.c: Continue work on output. ! *src/statistics.c: Remove structure, and change functions calls. ! *src/statistics.h: Remove structures. ! 2004-05-05 Mike H. Benton (bik...@us...) ! *src/main.c: Fixed problem with the loss of data_file_name. ! (get_data_file): Update. ! Did some housekeeping. ! *src/main.h: Added MAXFILENAME. ! *src/menu.c (do_file_menu): Update. ! ! 2004-04-26 Mike H. Benton (bik...@us...) ! *src/cmdline.c ! *src/cmdline.h: Updated using gengetopt version 2.12.1. *************** *** 58,64 **** (addrow): Fix to support fix memeory leak. (clear_struct): Added. ! *src/statistics.c: Added new headers from libmistat. ! *Added support for memwatch-2.71. --- 88,94 ---- (addrow): Fix to support fix memeory leak. (clear_struct): Added. ! *src/statistics.c: Added new headers from libmistat. ! *Added support for memwatch-2.71. *************** *** 67,75 **** *src/statistics.c (stats_main): Moved and implement verified ability. Implemented calls to more statistical functions in libmistat. ! (make_vector): Clean up for error check. *src/output.c (output_main): Implements said verifited ability. Some housekeeping. ! ! *src/menu.c: Overall change to prevent recursive call to menu_main. --- 97,105 ---- *src/statistics.c (stats_main): Moved and implement verified ability. Implemented calls to more statistical functions in libmistat. ! (make_vector): Clean up for error check. *src/output.c (output_main): Implements said verifited ability. Some housekeeping. ! ! *src/menu.c: Overall change to prevent recursive call to menu_main. *************** *** 88,92 **** *Added support for libmistat. Removed GSL support. *src/statistics.c: removed many functions and added basic support for ! libmistat. --- 118,122 ---- *Added support for libmistat. Removed GSL support. *src/statistics.c: removed many functions and added basic support for ! libmistat. *************** *** 150,154 **** (get_choice): modified to accept negative numbers, and make navigation easier. ! Also, some housekeeping. *src/menu.h: housekeeping. --- 180,184 ---- (get_choice): modified to accept negative numbers, and make navigation easier. ! Also, some housekeeping. *src/menu.h: housekeeping. *************** *** 188,192 **** */src: all *.h and *.c files: Processed with asytle and indent. The ! commands ! are: indent -bap and then astyle --style=gnu. --- 218,223 ---- */src: all *.h and *.c files: Processed with asytle and indent. The ! commands are: indent -bap and then astyle --style=gnu. ! ! |
|
From: Mike H. B. <bik...@us...> - 2004-05-29 18:22:32
|
Update of /cvsroot/mistat/mistat/Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14891/Data Added Files: PiDigits.dat Log Message: Added ability to read files that have float and int or just one. Not 100% on printing variable number. Some cleanup of function calls, and other housekeeping. --- NEW FILE: PiDigits.dat --- 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 [...4961 lines suppressed...] 0 8 0 9 9 8 8 8 6 8 7 4 1 3 2 6 0 4 7 2 |
|
From: Mike H. B. <bik...@us...> - 2004-05-22 06:33:12
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16549 Modified Files: ChangeLog Log Message: Cleanup of do_stats_choice in menu.c. Asset calls added to statistics.c. Support for different types of descriptive calls added to output.c. Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ChangeLog 20 May 2004 16:52:22 -0000 1.20 --- ChangeLog 22 May 2004 06:33:02 -0000 1.21 *************** *** 1,2 **** --- 1,12 ---- + 2004-05-22 Mike H. Benton (bik...@us...) + *src/menu.c (do_stas_choice): Clean up. + (get_choice): Support clean up. + + *src/output.c (desc): Support of basic or advanced descriptive statistics. + + #src/statistics.c (free_data): Added assert calls. + Added #include <assert.h> + + 2004-05-21 Mike H. Benton (bik...@us...) *src/output.c: Continued work on output. The basic method is there! |
|
From: Mike H. B. <bik...@us...> - 2004-05-22 06:33:12
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16549/src Modified Files: menu.c output.c statistics.c Log Message: Cleanup of do_stats_choice in menu.c. Asset calls added to statistics.c. Support for different types of descriptive calls added to output.c. Index: statistics.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** statistics.c 9 May 2004 15:06:33 -0000 1.30 --- statistics.c 22 May 2004 06:33:02 -0000 1.31 *************** *** 28,32 **** #include <stdlib.h> #include <math.h> /*For pow and sqrt. */ ! #include <libmistat/matrix.h> /*Vector and matrix functions. */ #include <libmistat/descriptives.h> /*Mean. */ --- 28,32 ---- #include <stdlib.h> #include <math.h> /*For pow and sqrt. */ ! #include <assert.h> /* The error checks. */ #include <libmistat/matrix.h> /*Vector and matrix functions. */ #include <libmistat/descriptives.h> /*Mean. */ *************** *** 224,228 **** free_data (int what_to_free) { ! printf ("Freeing the data!\n"); if (what_to_free == 0) --- 224,228 ---- free_data (int what_to_free) { ! assert (what_to_free >= 0 && what_to_free <= 3); if (what_to_free == 0) *************** *** 235,241 **** matrix_ld_free (mldta); else - { printf ("NOT a valid what_to_free!\n"); - } } --- 235,239 ---- Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** output.c 20 May 2004 16:52:22 -0000 1.26 --- output.c 22 May 2004 06:33:02 -0000 1.27 *************** *** 1,17 **** /* Output formatter and printer for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* Output formatter and printer for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 130,134 **** char results_col[11][MROW]; char *p_output; ! int i, im, output_size; long double results[11]; size_t j, k; --- 130,134 ---- char results_col[11][MROW]; char *p_output; ! int i, im, output_size, stop_me; long double results[11]; size_t j, k; *************** *** 152,155 **** --- 152,156 ---- char table_header[] = "\nDescriptive Statistis for"; char table_subheader[] = "Statistics\tValue\n"; + stop_me = 4; /* That is, only do until Sum. */ j = 6; /* Minimum length of results, or can fit "value". */ *************** *** 168,174 **** break; ! stat_test = get_sorted_stats (is_vector, im, results); ! if (stat_test == false) ! break; /* Lets get the title in. Determing how big the variable name is! */ --- 169,179 ---- break; ! if (all_stats == true) ! { ! stat_test = get_sorted_stats (is_vector, im, results); ! if (stat_test == false) ! break; ! stop_me = 10; ! } /* Lets get the title in. Determing how big the variable name is! */ *************** *** 180,184 **** * rasie the value of output_size to match results_col. */ ! for (i = 0; i <= 10; i++) { format_output (results_col[i], results[i]); --- 185,189 ---- * rasie the value of output_size to match results_col. */ ! for (i = 0; i <= stop_me; i++) { format_output (results_col[i], results[i]); *************** *** 202,206 **** sprintf (p_output, "%s %d\n", table_header, v[im] + 1); strcat (p_output, table_subheader); ! for (i = 0; i <= 10; i++) { strcat (p_output, stats_label[i]); --- 207,211 ---- sprintf (p_output, "%s %d\n", table_header, v[im] + 1); strcat (p_output, table_subheader); ! for (i = 0; i <= stop_me; i++) { strcat (p_output, stats_label[i]); *************** *** 271,279 **** /*Main output structure ! Sequence: get table input: regression, descriptive, and so on get length of results ! generate table (all to the sprintf thing) 1. title --- 276,284 ---- /*Main output structure ! Sequence: get table input: regression, descriptive, and so on get length of results ! generate table (all to the sprintf thing) 1. title Index: menu.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/menu.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** menu.c 20 May 2004 16:52:22 -0000 1.23 --- menu.c 22 May 2004 06:33:02 -0000 1.24 *************** *** 1,17 **** /* Entry point and handler for the menu system in mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* Entry point and handler for the menu system in mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 25,29 **** #include <stdio.h> /* Various printf and some file stuff (for the moment). */ #include <ctype.h> ! #include <stdlib.h> /* EXIT_FAILURE and malloc stuff. */ #include <string.h> /* Some string minipulations. */ --- 25,29 ---- #include <stdio.h> /* Various printf and some file stuff (for the moment). */ #include <ctype.h> ! #include <stdlib.h> /* EXIT_FAILURE and malloc stuff. */ #include <string.h> /* Some string minipulations. */ *************** *** 33,40 **** #include "menu.h" ! #include "file_ops.h" /* For opening and closing files. */ ! #include "output.h" /* Calls for printing and getting stats. */ ! #include "main.h" /* gl, and flag variables (print_digit,). */ ! #include "system.h" /* Bool use. */ void do_menu_choice (int choice); --- 33,40 ---- #include "menu.h" ! #include "file_ops.h" /* For opening and closing files. */ ! #include "output.h" /* Calls for printing and getting stats. */ ! #include "main.h" /* gl, and flag variables (print_digit,). */ ! #include "system.h" /* Bool use. */ void do_menu_choice (int choice); *************** *** 115,129 **** break; ! case options_menu: ! printf("The OPTIONS menu\n\n"); ! choice = get_choice (options_menu, 0, 8); ! /*Only 1 choice right now!*/ ! print_digit = choice; ! sprintf (temp, "\n\nNumber of sig. digits is now %d\n\n", print_digit); ! strncat (msg, temp, strlen (temp)); ! printf ("%s", msg); ! update_logfile (msg); ! break; case log_menu: --- 115,129 ---- break; ! case options_menu: ! printf ("The OPTIONS menu\n\n"); ! choice = get_choice (options_menu, 0, 8); ! /*Only 1 choice right now! */ ! print_digit = choice; ! sprintf (temp, "\n\nNumber of sig. digits is now %d\n\n", print_digit); ! strncat (msg, temp, strlen (temp)); ! printf ("%s", msg); ! update_logfile (msg); ! break; case log_menu: *************** *** 156,199 **** int i; ! switch (choice) ! { ! ! case descriptives: ! i = 0; ! v[i] = -2; ! while (v[i] <= -2) ! { ! printf ("first get choice\n"); ! v[i] = get_choice (descriptives, 1, columns); ! } ! if (v[i] >= 0) { ! i++; ! ! while (v[i - 1] >= 0) ! { ! v[i] = get_choice (descriptives, 1, columns); ! ! if (v[i] >= -1) ! i++; ! } ! ! verify = output_main (v, descriptives, 0); ! if (verify == false) ! { ! printf ("ERROR: Call to output_main failed!\n\n"); ! break; ! } } ! break; ! case more_descriptives: break; --- 156,192 ---- int i; ! /* Get the variables for input. */ ! i = 0; ! v[i] = -2; ! while (v[i] <= -2) ! { ! v[i] = get_choice (choice, 1, columns); ! } ! if (v[i] >= 0) ! { ! i++; ! while (v[i - 1] >= 0) { ! v[i] = get_choice (choice, 1, columns); ! if (v[i] >= -1) ! i++; } ! } ! else ! return; + /* We have the variables, now onto analysis/output. */ + switch (choice) + { + case descriptives: + case more_descriptives: + verify = output_main (v, choice, 0); break; *************** *** 213,218 **** printf ("ERROR: Invalid stats menu choice in do_stats_choice->%d<-\n", choice); ! exit (EXIT_FAILURE); } } --- 206,217 ---- printf ("ERROR: Invalid stats menu choice in do_stats_choice->%d<-\n", choice); ! break; } + + if (verify == false) + { + printf ("ERROR: Call to output_main failed!\n\n"); + } + } *************** *** 307,310 **** --- 306,310 ---- case descriptives: + case more_descriptives: printf ("\n\nInput variable number (1 to %d)\n", max_choices); break; *************** *** 369,376 **** */ ! /* ! * At this point, only options_menu will allow 0. ! * FIXME: what to really do! ! */ if (digits == 0 && menu_number != options_menu) return digits; /* Return to exit. */ --- 369,376 ---- */ ! /* ! * At this point, only options_menu will allow 0. ! * FIXME: what to really do! ! */ if (digits == 0 && menu_number != options_menu) return digits; /* Return to exit. */ *************** *** 398,401 **** --- 398,402 ---- case descriptives: + case more_descriptives: case simple_regression: digits = digits - 1; |
|
From: Mike H. B. <bik...@us...> - 2004-05-20 16:52:34
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18592 Modified Files: ChangeLog Log Message: I have the basic model for output! Descriptives are in place, and no memory leaks! Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ChangeLog 17 May 2004 17:22:20 -0000 1.19 --- ChangeLog 20 May 2004 16:52:22 -0000 1.20 *************** *** 1,2 **** --- 1,8 ---- + 2004-05-21 Mike H. Benton (bik...@us...) + *src/output.c: Continued work on output. The basic method is there! + *src/output.h: Changed call to output_main. + *src/menu.c: Support change in call to output_main. + + 2004-05-18 Mike H. Benton (bik...@us...) *src/error.c (my_gsl_error_check): Removed as not using gsl. |
|
From: Mike H. B. <bik...@us...> - 2004-05-20 16:52:33
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18592/src Modified Files: menu.c output.c output.h Log Message: I have the basic model for output! Descriptives are in place, and no memory leaks! Index: output.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** output.h 9 May 2004 15:06:33 -0000 1.12 --- output.h 20 May 2004 16:52:22 -0000 1.13 *************** *** 39,43 **** * RETURN: true if succesful. */ ! bool output_main (int v[], int routine); /* --- 39,43 ---- * RETURN: true if succesful. */ ! bool output_main (int v[], int routine, int stats_to_do); /* Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** output.c 17 May 2004 17:22:21 -0000 1.25 --- output.c 20 May 2004 16:52:22 -0000 1.26 *************** *** 50,58 **** * Functions */ ! void desc (bool vector_flag, int v[]); /* Print descriptive tables. */ void format_output (char *input, double value); /* Adjust for number of sig digits. */ bool ! output_main (int v[], int routine) { bool verify; --- 50,58 ---- * Functions */ ! void desc (bool vector_flag, bool all_stats, int v[]); /* Print descriptive tables. */ void format_output (char *input, double value); /* Adjust for number of sig digits. */ bool ! output_main (int v[], int routine, int stats_to_do) { bool verify; *************** *** 103,107 **** { case descriptives: ! desc (FLAG_VECTOR, v); break; --- 103,111 ---- { case descriptives: ! desc (FLAG_VECTOR, false, v); ! break; ! ! case more_descriptives: ! desc (FLAG_VECTOR, true, v); break; *************** *** 120,131 **** } - /*FIXME: do I need to pass v[]? The matrix has the info?. Perhaps for printing variable stuff?. */ void ! desc (bool is_vector, int v[]) { bool stat_test; char results_col[11][MROW]; char *p_output; - float temp; int i, im, output_size; long double results[11]; --- 124,133 ---- } void ! desc (bool is_vector, bool all_stats, int v[]) { bool stat_test; char results_col[11][MROW]; char *p_output; int i, im, output_size; long double results[11]; *************** *** 153,176 **** j = 6; /* Minimum length of results, or can fit "value". */ ! if (is_vector) ! { /* Just one variable. */ ! ! stat_test = get_mean (is_vector, 1, results); if (stat_test == false) ! { ! return; ! } ! stat_test = get_sorted_stats (is_vector, 1, results); if (stat_test == false) ! { ! return; ! } /* Lets get the title in. Determing how big the variable name is! */ ! temp = 0.0; ! output_size = sizeof (table_header) + sizeof (table_subheader) + log (*v + 1) + 3; /* Pad for log, space, and \n. */ for (i = 0; i <= 10; i++) { --- 155,183 ---- j = 6; /* Minimum length of results, or can fit "value". */ ! /* Populate the first row with title. */ ! output_size = sizeof (table_header); + /* + * Loop through the variables, and print output. + */ + for (im = 0; im <= NUM_VARS - 1; im++) + { + /* Get the stats. */ + stat_test = get_mean (is_vector, im, results); if (stat_test == false) ! break; + stat_test = get_sorted_stats (is_vector, im, results); if (stat_test == false) ! break; /* Lets get the title in. Determing how big the variable name is! */ ! /* Pad for log, space, and \n. */ ! output_size += sizeof (table_subheader) + log (v[im] + 1) + 3; + /* + * Populate the results_col for sig digits. Also, + * rasie the value of output_size to match results_col. + */ for (i = 0; i <= 10; i++) { *************** *** 180,197 **** j = k; } ! output_size = output_size + j + strlen (stats_label[i]) + 10; ! } ! p_output = malloc (output_size * sizeof (char)); if (p_output == NULL) { printf ("ERROR: cannot allocate memory for output\n"); ! return; } ! sprintf (p_output, "%s %d\n", table_header, *v + 1); strcat (p_output, table_subheader); - for (i = 0; i <= 10; i++) { --- 187,205 ---- j = k; } ! output_size += j + strlen (stats_label[i]); } ! p_output = (char *) malloc (output_size * sizeof (char)); if (p_output == NULL) { printf ("ERROR: cannot allocate memory for output\n"); ! break; } ! /* ! * Make the table. ! */ ! sprintf (p_output, "%s %d\n", table_header, v[im] + 1); strcat (p_output, table_subheader); for (i = 0; i <= 10; i++) { *************** *** 200,241 **** } printf ("%s", p_output); update_logfile (p_output); free (p_output); - } ! else ! { /*We have a matrix, so handle each varible. */ ! for (im = 0; im <= NUM_VARS - 1; im++) ! { ! stat_test = get_mean (is_vector, im, results); ! ! if (stat_test == false) ! return; ! ! stat_test = get_sorted_stats (is_vector, im, results); ! ! if (stat_test == false) ! return; ! ! printf ("\nDescriptive Statistics for %d\n", v[im] + 1); ! printf ("Statistic\tValue\n"); ! ! for (i = 0; i <= 10; i++) ! { ! format_output (results_col[i], results[i]); ! if ((k = strlen (results_col[i])) > j) ! { ! j = k; ! } ! printf ("%s\t%s\n", stats_label[i], results_col[i]); ! } - if (im % 2) - gl_get_line (gl, "Hit Enter to Continue", NULL, -1); - } } - } --- 208,221 ---- } + /* Finally, print and free. */ printf ("%s", p_output); update_logfile (p_output); free (p_output); ! /*FIXME: This needs upped. */ ! gl_get_line (gl, "Hit Enter to Continue", NULL, -1); } } *************** *** 243,246 **** --- 223,228 ---- format_output (char *input, double value) { + assert (print_digit >= 0 && print_digit <= 8); + switch (print_digit) { *************** *** 290,307 **** /*Main output structure ! Sequence: ! get table input: regression, descriptive, and so on ! get length of results ! generate table (all to the sprintf thing) ! 1. title ! 2. top bar ! 3. labels ! 4. sub bar ! 5. results ! 7. bottom bars ! 8. again for other tables--e.g. regression ! output ! */ /*Here ends output.c. */ --- 272,289 ---- /*Main output structure ! Sequence: ! get table input: regression, descriptive, and so on ! get length of results ! generate table (all to the sprintf thing) ! 1. title ! 2. top bar ! 3. labels ! 4. sub bar ! 5. results ! 7. bottom bars ! 8. again for other tables--e.g. regression ! output ! */ /*Here ends output.c. */ Index: menu.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/menu.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** menu.c 9 May 2004 15:06:33 -0000 1.22 --- menu.c 20 May 2004 16:52:22 -0000 1.23 *************** *** 182,186 **** } ! verify = output_main (v, descriptives); if (verify == false) --- 182,186 ---- } ! verify = output_main (v, descriptives, 0); if (verify == false) |
|
From: Mike H. B. <bik...@us...> - 2004-05-17 17:22:30
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12368/src Modified Files: error.c output.c Log Message: Contine with output.c work. The memory allocation is fine; but, need to work on matrix. Housekeeping in error.c. Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** output.c 9 May 2004 15:06:33 -0000 1.24 --- output.c 17 May 2004 17:22:21 -0000 1.25 *************** *** 27,35 **** */ ! #include <stdio.h> ! #include <stdlib.h> ! #include <string.h> ! #include <assert.h> #include "output.h" #include "statistics.h" /* Calls to statistical routines. */ --- 27,38 ---- */ ! #include <stdio.h> /* Various types of printf. */ ! #include <stdlib.h> /* Allocation calls. */ ! #include <string.h> /* Various uses of string functions. */ ! #include <assert.h> /* The error checks. */ ! #include <math.h> /* The log function is used in desc to determine v lenght. */ ! /*Use -ltecla for linking*/ + #include <libtecla.h> /* Use for input. */ #include "output.h" #include "statistics.h" /* Calls to statistical routines. */ *************** *** 41,47 **** * Variables */ ! bool FLAG_VECTOR; /*Vector or matrix (number of variables = 1). */ ! int NUM_VARS; /*Number of variables for analysis. */ ! /* * Functions --- 44,50 ---- * Variables */ ! bool FLAG_VECTOR; /* Vector or matrix (number of variables = 1). */ ! int NUM_VARS; /* Number of variables for analysis. */ ! extern GetLine *gl; /* The getline variable for libtecla. */ /* * Functions *************** *** 121,140 **** desc (bool is_vector, int v[]) { char results_col[11][MROW]; ! int i, im, j, k; long double results[11]; ! char DESC_TABLE[11][16] = { ! {"Mean\t"}, ! {"Variance"}, ! {"Skewness"}, ! {"Kurtosis"}, ! {"Sum\t"}, ! {"Min\t"}, ! {"Max\t"}, ! {"Median\t"}, ! {"Lower Quartile"}, ! {"Upper Quartile"}, ! {"IQR\t"} ! }; j = 6; /* Minimum length of results, or can fit "value". */ --- 124,153 ---- desc (bool is_vector, int v[]) { + bool stat_test; char results_col[11][MROW]; ! char *p_output; ! float temp; ! int i, im, output_size; long double results[11]; ! size_t j, k; ! ! /* ! * Set up the hard table values. ! */ ! char stats_label[11][20] = { ! {"Mean\t\t"}, ! {"Variance\t"}, ! {"Skewness\t"}, ! {"Kurtosis\t"}, ! {"Sum\t\t"}, ! {"Min\t\t"}, ! {"Max\t\t"}, ! {"Median\t\t"}, ! {"Lower Quartile\t"}, ! {"Upper Quartile\t"}, ! {"IQR\t\t"} ! }; ! char table_header[] = "\nDescriptive Statistis for"; ! char table_subheader[] = "Statistics\tValue\n"; j = 6; /* Minimum length of results, or can fit "value". */ *************** *** 143,151 **** { /* Just one variable. */ ! get_mean (is_vector, 1, results); ! get_sorted_stats (is_vector, 1, results); ! printf ("\nDescriptive Statistics for %d\n", *v + 1); ! printf ("Statistic\tValue\n"); for (i = 0; i <= 10; i++) --- 156,175 ---- { /* Just one variable. */ ! stat_test = get_mean (is_vector, 1, results); ! if (stat_test == false) ! { ! return; ! } ! stat_test = get_sorted_stats (is_vector, 1, results); ! ! if (stat_test == false) ! { ! return; ! } ! ! /* Lets get the title in. Determing how big the variable name is! */ ! temp = 0.0; ! output_size = sizeof (table_header) + sizeof (table_subheader) + log (*v + 1) + 3; /* Pad for log, space, and \n. */ for (i = 0; i <= 10; i++) *************** *** 156,162 **** j = k; } ! printf ("%s\t%s\n", DESC_TABLE[i], results_col[i]); } } --- 180,206 ---- j = k; } ! output_size = output_size + j + strlen (stats_label[i]) + 10; ! } + p_output = malloc (output_size * sizeof (char)); + if (p_output == NULL) + { + printf ("ERROR: cannot allocate memory for output\n"); + return; + } + + sprintf (p_output, "%s %d\n", table_header, *v + 1); + strcat (p_output, table_subheader); + + for (i = 0; i <= 10; i++) + { + strcat (p_output, stats_label[i]); + strcat (p_output, results_col[i]); + } + + printf ("%s", p_output); + update_logfile (p_output); + free (p_output); } *************** *** 165,170 **** for (im = 0; im <= NUM_VARS - 1; im++) { ! get_mean (is_vector, im, results); ! get_sorted_stats (is_vector, im, results); printf ("\nDescriptive Statistics for %d\n", v[im] + 1); --- 209,221 ---- for (im = 0; im <= NUM_VARS - 1; im++) { ! stat_test = get_mean (is_vector, im, results); ! ! if (stat_test == false) ! return; ! ! stat_test = get_sorted_stats (is_vector, im, results); ! ! if (stat_test == false) ! return; printf ("\nDescriptive Statistics for %d\n", v[im] + 1); *************** *** 178,186 **** j = k; } ! printf ("%s\t%s\n", DESC_TABLE[i], results_col[i]); } } } } --- 229,241 ---- j = k; } ! printf ("%s\t%s\n", stats_label[i], results_col[i]); } + + if (im % 2) + gl_get_line (gl, "Hit Enter to Continue", NULL, -1); } } + } *************** *** 192,228 **** case 0: ! sprintf (input, "%.0f", value); break; case 1: ! sprintf (input, "%.1f", value); break; case 2: ! sprintf (input, "%.2f", value); break; case 3: ! sprintf (input, "%.3f", value); break; case 4: ! sprintf (input, "%.4f", value); break; case 5: ! sprintf (input, "%.5f", value); break; case 6: ! sprintf (input, "%.6f", value); break; case 7: ! sprintf (input, "%.7f", value); break; case 8: ! sprintf (input, "%.8f", value); break; --- 247,283 ---- case 0: ! sprintf (input, "%.0f\n", value); break; case 1: ! sprintf (input, "%.1f\n", value); break; case 2: ! sprintf (input, "%.2f\n", value); break; case 3: ! sprintf (input, "%.3f\n", value); break; case 4: ! sprintf (input, "%.4f\n", value); break; case 5: ! sprintf (input, "%.5f\n", value); break; case 6: ! sprintf (input, "%.6f\n", value); break; case 7: ! sprintf (input, "%.7f\n", value); break; case 8: ! sprintf (input, "%.8f\n", value); break; Index: error.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/error.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** error.c 30 Mar 2004 15:49:48 -0000 1.7 --- error.c 17 May 2004 17:22:20 -0000 1.8 *************** *** 1,22 **** /* Error handling for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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. */ - /*error.c*/ --- 1,21 ---- /* Error handling for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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. */ /*error.c*/ *************** *** 108,138 **** } ! /*Now we move onto the custom gsl error handlers.*/ ! ! /*int ! my_gsl_error_check (int status) ! { ! switch (status) ! { ! ! case -1: ! printf ("ERROR in gsl."); ! exit (EXIT_FAILURE); ! break; ! ! case 0:*/ ! /*Should not call but just in case. */ ! /*return true; ! break; ! ! ! ! default: ! printf ("ERROR: Invalid status sent to my_gsl_error_check->%d<-\n", ! status); ! exit (EXIT_FAILURE); ! break; ! ! } ! ! }*/ --- 107,109 ---- } ! /* Here ends error.c. */ |
|
From: Mike H. B. <bik...@us...> - 2004-05-17 17:22:30
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12368 Modified Files: ChangeLog Log Message: Contine with output.c work. The memory allocation is fine; but, need to work on matrix. Housekeeping in error.c. Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ChangeLog 9 May 2004 15:06:32 -0000 1.18 --- ChangeLog 17 May 2004 17:22:20 -0000 1.19 *************** *** 1,2 **** --- 1,8 ---- + 2004-05-18 Mike H. Benton (bik...@us...) + *src/error.c (my_gsl_error_check): Removed as not using gsl. + + *src/output.c: Continue work on output. About there for basic method. + + 2004-05-09 Mike H. Benton (bik...@us...) *ChangeLog: Fixed a few datas (04's were 05's) |
|
From: Mike H. B. <bik...@us...> - 2004-05-09 15:06:44
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31552/src Modified Files: main.c menu.c output.c output.h statistics.c statistics.h Log Message: Still working on ouput. Big changes to statistics.c (no more structures). Put the abilit to chage sig digits back in. Some housekeeping in main. Fix typos in ChangeLog Index: statistics.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** statistics.c 25 Apr 2004 22:30:44 -0000 1.29 --- statistics.c 9 May 2004 15:06:33 -0000 1.30 *************** *** 19,26 **** */ /* statistics.c */ ! /*USAGE: stats_main must be called to build a vector or matrix. * Then, call the various statistical routines. All routines must be supplied ! * with a boolean value: true for vector, false for matrix. The routines return ! * write to a structure. */ --- 19,26 ---- */ /* statistics.c */ ! /*USAGE: stats_main must be called to build a vector or matrix that is used for analysis. * Then, call the various statistical routines. All routines must be supplied ! * with a boolean value: true for vector, false for matrix. ! * The routines write to supplied array. */ *************** *** 50,56 **** /* ! ** Populate vector or matrix before calling stat functions. ! ** Using as a central call point. ! ** Return false if cannot make a vector or matrix. */ bool --- 50,56 ---- /* ! ** Populate vector or matrix before calling stat functions. ! ** Using as a central call point. ! ** Return false if cannot make a vector or matrix. */ bool *************** *** 61,65 **** verified = false; /* Set as false, called proceures will change to true if succesful. */ ! if (vector) /* Make a vector from variable and index. */ { variable = x[0]; --- 61,65 ---- verified = false; /* Set as false, called proceures will change to true if succesful. */ ! if (vector) /* Make a vector. */ { variable = x[0]; *************** *** 73,76 **** --- 73,77 ---- return verified; + } *************** *** 78,82 **** * Basic statistical functions. * Supply is_vector. ! * Return to structures. */ --- 79,83 ---- * Basic statistical functions. * Supply is_vector. ! * Return to true/false. */ *************** *** 84,120 **** * Calculates all moments. */ ! void ! get_mean (bool is_vector, int index) { - long double temp, temp1; - long double mean, variance, skewness, kurtosis; int sum; - - /*temp is additive, so must be set to 0 before all calculations! */ - temp = temp1 = 0; - if (is_vector) /*Just get moments for one variable. */ { ! mean = mean_int_vector (vta, index, nrows, &sum); ! variance = var_int_vector (vta, &mean, index, nrows); ! skewness = skewness_int_vector (vta, &variance, &mean, nrows); ! kurtosis = kurtosis_int_vector (vta, &variance, &mean, nrows); } else /*Get moments from matrix. */ { ! mean = mean_int_matrix (mta, index, nrows, &sum); ! variance = var_int_matrix (mta, &mean, index, nrows); ! skewness = skewness_int_matrix (mta, index, &variance, &mean, nrows); ! kurtosis = kurtosis_int_matrix (mta, index, &variance, &mean, nrows); } ! D_STATS.mean = mean; ! D_STATS.variance = variance; ! D_STATS.skewness = skewness; ! D_STATS.kurtosis = kurtosis; ! D_STATS.sum = sum; ! } --- 85,114 ---- * Calculates all moments. */ ! bool ! get_mean (bool is_vector, int index, long double results[]) { int sum; if (is_vector) /*Just get moments for one variable. */ { ! ! results[0] = mean_int_vector (vta, index, nrows, &sum); ! results[1] = var_int_vector (vta, &results[0], index, nrows); ! results[2] = skewness_int_vector (vta, &results[1], &results[0], nrows); ! results[3] = kurtosis_int_vector (vta, &results[1], &results[0], nrows); } else /*Get moments from matrix. */ { ! results[0] = mean_int_matrix (mta, index, nrows, &sum); ! results[1] = var_int_matrix (mta, &results[0], index, nrows); ! results[2] = skewness_int_matrix (mta, index, &results[1], &results[0], nrows); ! results[3] = kurtosis_int_matrix (mta, index, &results[1], &results[0], nrows); } ! results[4] = sum; ! ! return true; ! } *************** *** 122,137 **** * Sorted type statistics and tails. */ ! void ! get_sorted_stats (bool is_vector, int index) { - long double median, min, max, l_quart, u_quart; - if (is_vector) /*Process vector data. */ { ! min = vector_int_min (vta); ! max = vector_int_max (vta); q_sort_int_vector (vta, 1, nrows); ! median = median_int_vector (vta, nrows); ! quartiles_int_vector (vta, nrows, &l_quart, &u_quart); } --- 116,129 ---- * Sorted type statistics and tails. */ ! bool ! get_sorted_stats (bool is_vector, int index, long double results[]) { if (is_vector) /*Process vector data. */ { ! results[5] = vector_int_min (vta); ! results[6] = vector_int_max (vta); q_sort_int_vector (vta, 1, nrows); ! results[7] = median_int_vector (vta, nrows); ! quartiles_int_vector (vta, nrows, &results[8], &results[9]); } *************** *** 139,155 **** { ! min = matrix_int_min (mta, index); ! max = matrix_int_max (mta, index); q_sort_int_matrix (mta, index, 1, nrows); ! median = median_int_matrix (mta, index, nrows); ! quartiles_int_matrix (mta, index, nrows, &l_quart, &u_quart); } ! S_STATS.min = min; ! S_STATS.max = max; ! S_STATS.median = median; ! S_STATS.l_quart = l_quart; ! S_STATS.u_quart = u_quart; ! S_STATS.iqr = (u_quart - l_quart); } --- 131,144 ---- { ! results[5] = matrix_int_min (mta, index); ! results[6] = matrix_int_max (mta, index); q_sort_int_matrix (mta, index, 1, nrows); ! results[7] = median_int_matrix (mta, index, nrows); ! quartiles_int_matrix (mta, index, nrows, &results[8], &results[9]); } ! results[10] = (results[9] - results[8]); ! ! return true; } *************** *** 158,162 **** ** Fill up vector for analysis. ** Use var_column is for the particular variable. ! ** Returns false if not enough calloc fails. */ bool --- 147,151 ---- ** Fill up vector for analysis. ** Use var_column is for the particular variable. ! ** Returns false if not enough calloc fails. */ bool *************** *** 166,179 **** int t[MAXROWS]; vta = vector_int_calloc (nrows); if (vta == NULL) return false; /*Fill t with data. */ getit (data_file, var_column, t); ! ! i = 0; ! /*Put t into a vector. */ while (i < nrows) --- 155,171 ---- int t[MAXROWS]; + i = 0; vta = vector_int_calloc (nrows); if (vta == NULL) + { + printf + ("Cannot allocate memory in make_vector\n Free memory, reboot, or report file size in a bug report.\n"); return false; + } /*Fill t with data. */ getit (data_file, var_column, t); ! /*Put t into a vector. */ while (i < nrows) *************** *** 182,187 **** i++; } ! return true; } --- 174,180 ---- i++; } ! return true; + } *************** *** 192,210 **** int t[MAXROWS]; ! /*Allocate matrix */ mta = matrix_int_calloc (nrows, NUM_VARS); - - i = 1; - if (mta == NULL) { printf ! ("Cannot allocate memory in make_simple_matrix\n Free memory, reboot, or report file size in a bug report.\n"); return false; } /*Read data into matrix */ - while (i <= NUM_VARS) { --- 185,200 ---- int t[MAXROWS]; ! i = 1; + /*Allocate matrix */ mta = matrix_int_calloc (nrows, NUM_VARS); if (mta == NULL) { printf ! ("Cannot allocate memory in make_matrix\n Free memory, reboot, or report file size in a bug report.\n"); return false; } /*Read data into matrix */ while (i <= NUM_VARS) { *************** *** 212,215 **** --- 202,206 ---- getit (data_file, temp, t); + c = 0; while (c < nrows) *************** *** 223,226 **** --- 214,218 ---- return true; + } *************** *** 245,252 **** { printf ("NOT a valid what_to_free!\n"); - exit (EXIT_FAILURE); } - } --- 237,242 ---- Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** output.c 25 Apr 2004 22:30:43 -0000 1.23 --- output.c 9 May 2004 15:06:33 -0000 1.24 *************** *** 1,17 **** /* Output formatter and printer for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* Output formatter and printer for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 33,63 **** #include "output.h" ! #include "statistics.h" ! ! #include "menu.h" ! /* Output structure. ! * Used to add lines and such for output. */ - struct results - { - char *to_print; - struct results *next; - }; - - - bool FLAG_VECTOR; /*Vector or matrix (number of variables = 1). */ int NUM_VARS; /*Number of variables for analysis. */ - void desc (bool vector_flag, int v[]); /*Print descriptive tables. */ - struct results *addrow (char *text, struct results *previous); - - struct results *clear_struct (struct results *previous); - /* ! * Supply variables to be analyzed, and statistical routine. ! * Returns true if succesful. */ bool output_main (int v[], int routine) --- 33,53 ---- #include "output.h" ! #include "statistics.h" /* Calls to statistical routines. */ ! #include "main.h" /* Flag variables (print_digits). */ ! #include "menu.h" /* Enumeration values. */ ! #include "file_ops.h" /* Sending data to the logfile. */ ! /* ! * Variables */ bool FLAG_VECTOR; /*Vector or matrix (number of variables = 1). */ int NUM_VARS; /*Number of variables for analysis. */ /* ! * Functions */ + void desc (bool vector_flag, int v[]); /* Print descriptive tables. */ + void format_output (char *input, double value); /* Adjust for number of sig digits. */ + bool output_main (int v[], int routine) *************** *** 131,237 **** desc (bool is_vector, int v[]) { ! char *row; ! int i; ! struct results *top = NULL; ! struct results *p; ! row = "\nDescriptives\n"; ! top = addrow (row, top); if (is_vector) { /* Just one variable. */ - get_mean (is_vector, 1); - get_sorted_stats (is_vector, 1); ! /*FIXME: temp printing routine. */ ! for (p = top; p != NULL; p = p->next) ! printf ("%s", p->to_print); - printf - (" mean = %f\n skew = %f\n kur = %f\n var = %f\n sum = %f\n median = %f\n min = %f\n max = %f\n lower = %f\n higher = %f\n iqr = %f\n\n", - D_STATS.mean, D_STATS.skewness, D_STATS.kurtosis, - D_STATS.variance, D_STATS.sum, S_STATS.median, S_STATS.min, - S_STATS.max, S_STATS.l_quart, S_STATS.u_quart, S_STATS.iqr); } else { /*We have a matrix, so handle each varible. */ ! /*FIXME: temp printing routines. */ ! for (p = top; p != NULL; p = p->next) ! printf ("%s", p->to_print); ! ! for (i = 0; i <= NUM_VARS - 1; i++) { ! get_mean (is_vector, i); ! get_sorted_stats (is_vector, i); ! printf ! (" mean = %f\n skew = %f\n kur = %f\n var = %f\n sum = %f\n median = %f\n min = %f\n max = %f\n lower = %f\n higher = %f\n iqr = %f\n\n", ! D_STATS.mean, D_STATS.skewness, D_STATS.kurtosis, ! D_STATS.variance, D_STATS.sum, S_STATS.median, ! S_STATS.min, S_STATS.max, S_STATS.l_quart, ! S_STATS.u_quart, S_STATS.iqr); ! } ! } ! while (top != NULL) ! { ! free (top->to_print); ! top = clear_struct (top); } } ! /*FIXME: need to just clear and return if cannot allocate.*/ ! /*FIXME: need to free.*/ ! struct results * ! addrow (char *text, struct results *previous) ! { ! struct results *newrow = previous; ! if (previous != NULL) ! { ! /* Rewind if necessary. */ ! while (previous->next != NULL) ! previous = previous->next; ! previous->next = malloc (sizeof (struct results)); ! previous = previous->next; ! previous->next = NULL; ! previous->to_print = malloc (strlen (text) + 1); ! strcpy (previous->to_print, text); ! return newrow; ! } ! else ! { ! previous = malloc (sizeof (struct results)); ! previous->next = NULL; ! previous->to_print = malloc (strlen (text) + 1); ! strcpy (previous->to_print, text); ! return previous; ! } ! } ! struct results * ! clear_struct (struct results *previous) ! { ! struct results *temp; ! temp = previous->next; ! free (previous); ! return temp; ! } /*Main output structure ! Sequence: get table input: regression, descriptive, and so on get length of results ! generate table (all to the sprintf thing) 1. title --- 121,242 ---- desc (bool is_vector, int v[]) { ! char results_col[11][MROW]; ! int i, im, j, k; ! long double results[11]; ! char DESC_TABLE[11][16] = { ! {"Mean\t"}, ! {"Variance"}, ! {"Skewness"}, ! {"Kurtosis"}, ! {"Sum\t"}, ! {"Min\t"}, ! {"Max\t"}, ! {"Median\t"}, ! {"Lower Quartile"}, ! {"Upper Quartile"}, ! {"IQR\t"} ! }; ! j = 6; /* Minimum length of results, or can fit "value". */ if (is_vector) { /* Just one variable. */ ! get_mean (is_vector, 1, results); ! get_sorted_stats (is_vector, 1, results); ! ! printf ("\nDescriptive Statistics for %d\n", *v + 1); ! printf ("Statistic\tValue\n"); ! ! for (i = 0; i <= 10; i++) ! { ! format_output (results_col[i], results[i]); ! if ((k = strlen (results_col[i])) > j) ! { ! j = k; ! } ! printf ("%s\t%s\n", DESC_TABLE[i], results_col[i]); ! } } else { /*We have a matrix, so handle each varible. */ ! for (im = 0; im <= NUM_VARS - 1; im++) { ! get_mean (is_vector, im, results); ! get_sorted_stats (is_vector, im, results); ! printf ("\nDescriptive Statistics for %d\n", v[im] + 1); ! printf ("Statistic\tValue\n"); ! ! for (i = 0; i <= 10; i++) ! { ! format_output (results_col[i], results[i]); ! if ((k = strlen (results_col[i])) > j) ! { ! j = k; ! } ! printf ("%s\t%s\n", DESC_TABLE[i], results_col[i]); ! } ! } } } ! void ! format_output (char *input, double value) ! { ! switch (print_digit) ! { ! case 0: ! sprintf (input, "%.0f", value); ! break; ! case 1: ! sprintf (input, "%.1f", value); ! break; ! case 2: ! sprintf (input, "%.2f", value); ! break; ! case 3: ! sprintf (input, "%.3f", value); ! break; ! case 4: ! sprintf (input, "%.4f", value); ! break; ! case 5: ! sprintf (input, "%.5f", value); ! break; ! case 6: ! sprintf (input, "%.6f", value); ! break; ! case 7: ! sprintf (input, "%.7f", value); ! break; ! case 8: ! sprintf (input, "%.8f", value); ! break; ! default: ! printf ("ERROR: not a valid print_digit in format_output!\n\n"); ! break; ! } ! } /*Main output structure ! Sequence: get table input: regression, descriptive, and so on get length of results ! generate table (all to the sprintf thing) 1. title Index: output.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** output.h 15 Mar 2004 15:07:26 -0000 1.11 --- output.h 9 May 2004 15:06:33 -0000 1.12 *************** *** 23,32 **** #define OUTPUT_H ! #include "system.h" /*For bool and c_v variables. */ /* * Defines */ ! #define MCOL 60 /*Maximum columin width is 60. */ /* --- 23,33 ---- #define OUTPUT_H ! #include "system.h" /* For bool and c_v variables. */ /* * Defines */ ! #define MCOL 60 /* Maximum columin width is 60. */ ! #define MROW 100 /* Maximum number of rows is 100. */ /* Index: statistics.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** statistics.h 25 Apr 2004 22:30:44 -0000 1.17 --- statistics.h 9 May 2004 15:06:33 -0000 1.18 *************** *** 23,68 **** #define STATS_H ! #include "system.h" ! ! /* ! * Structures ! */ ! ! struct MOMENTS ! { ! double mean; ! double skewness; ! double kurtosis; ! double variance; ! double sum; ! } ! D_STATS; ! ! struct RANGES ! { ! double min; ! double max; ! double median; ! double upper_tail; ! double lower_tail; ! double l_quart; ! double u_quart; ! double iqr; ! } ! S_STATS; /* * Prototypes */ ! /* Most statistical routines have bool is_vector. Basically, * this determines if a vector or matrix is input for analysis. ! * The variable for analysis is supplied for maxrix only as index. ! * All statistical values write to structures. ! * All data is freed by calling routine. */ bool stats_main (int x[], bool is_vector); ! void get_mean (bool is_vector, int index); ! void get_sorted_stats (bool is_vector, int index); void free_data (int what_to_free); --- 23,41 ---- #define STATS_H ! #include "system.h" /* For bool. */ /* * Prototypes */ ! /* Most statistical routines have is_vector. Basically, * this determines if a vector or matrix is input for analysis. ! * The variable for analysis for a maxrix is index. ! * All statistical values write to supplied array. ! * All return true or false. */ bool stats_main (int x[], bool is_vector); ! bool get_mean (bool is_vector, int index, long double results []); ! bool get_sorted_stats (bool is_vector, int index, long double results []); void free_data (int what_to_free); Index: main.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** main.c 5 May 2004 08:05:43 -0000 1.12 --- main.c 9 May 2004 15:06:33 -0000 1.13 *************** *** 1,17 **** /* Entry point for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* Entry point for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 76,80 **** main (int argc, char **argv) { - /*Start the error handling */ set_signals (); --- 76,79 ---- *************** *** 104,108 **** exit_mistat (); ! return (0); } --- 103,107 ---- exit_mistat (); ! return 0; } Index: menu.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/menu.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** menu.c 5 May 2004 08:05:43 -0000 1.21 --- menu.c 9 May 2004 15:06:33 -0000 1.22 *************** *** 1,17 **** /* Entry point and handler for the menu system in mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* Entry point and handler for the menu system in mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 25,29 **** #include <stdio.h> /* Various printf and some file stuff (for the moment). */ #include <ctype.h> ! #include <stdlib.h> #include <string.h> /* Some string minipulations. */ --- 25,29 ---- #include <stdio.h> /* Various printf and some file stuff (for the moment). */ #include <ctype.h> ! #include <stdlib.h> /* EXIT_FAILURE and malloc stuff. */ #include <string.h> /* Some string minipulations. */ *************** *** 33,40 **** #include "menu.h" ! #include "file_ops.h" ! #include "output.h" ! #include "main.h" ! #include "system.h" void do_menu_choice (int choice); --- 33,40 ---- #include "menu.h" ! #include "file_ops.h" /* For opening and closing files. */ ! #include "output.h" /* Calls for printing and getting stats. */ ! #include "main.h" /* gl, and flag variables (print_digit,). */ ! #include "system.h" /* Bool use. */ void do_menu_choice (int choice); *************** *** 86,89 **** --- 86,90 ---- { char *msg; + char temp[99]; msg = (char *) calloc (100, sizeof (char)); *************** *** 114,120 **** break; ! case options_menu: ! printf ("The OPTIONS menu\n\n"); ! break; case log_menu: --- 115,129 ---- break; ! case options_menu: ! printf("The OPTIONS menu\n\n"); ! choice = get_choice (options_menu, 0, 8); ! ! /*Only 1 choice right now!*/ ! print_digit = choice; ! sprintf (temp, "\n\nNumber of sig. digits is now %d\n\n", print_digit); ! strncat (msg, temp, strlen (temp)); ! printf ("%s", msg); ! update_logfile (msg); ! break; case log_menu: *************** *** 359,362 **** --- 368,376 ---- * The various switch parts do addition to choice. */ + + /* + * At this point, only options_menu will allow 0. + * FIXME: what to really do! + */ if (digits == 0 && menu_number != options_menu) return digits; /* Return to exit. */ |
|
From: Mike H. B. <bik...@us...> - 2004-05-09 15:06:41
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31552 Modified Files: ChangeLog Log Message: Still working on ouput. Big changes to statistics.c (no more structures). Put the abilit to chage sig digits back in. Some housekeeping in main. Fix typos in ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ChangeLog 5 May 2004 08:05:42 -0000 1.17 --- ChangeLog 9 May 2004 15:06:32 -0000 1.18 *************** *** 1,2 **** --- 1,15 ---- + 2004-05-09 Mike H. Benton (bik...@us...) + *ChangeLog: Fixed a few datas (04's were 05's) + + *src/main.c (main): Housekeeping (return(0) to just return 0); + + *src/menu.c (do_menu_choice): Re-implement ability to change sig digits. + Housekeeping. + + *src/ouput.c: Continue work on output. + *src/statistics.c: Remove structure, and change functions calls. + *src/statistics.h: Remove structures. + + 2004-05-05 Mike H. Benton (bik...@us...) *src/main.c: Fixed problem with the loss of data_file_name. *************** *** 7,16 **** ! 2004-05-26 Mike H. Benton (bik...@us...) *src/cmdline.c *src/cmdline.h: Updated using gengetopt version 2.12.1. ! 2004-05-20 Mike H. Benton (bik...@us...) *src/statistics.c (get_mean): Added matrix calls. (get_storted_stats): Added matrix calls. --- 20,29 ---- ! 2004-04-26 Mike H. Benton (bik...@us...) *src/cmdline.c *src/cmdline.h: Updated using gengetopt version 2.12.1. ! 2004-04-20 Mike H. Benton (bik...@us...) *src/statistics.c (get_mean): Added matrix calls. (get_storted_stats): Added matrix calls. *************** *** 18,22 **** ! 2004-05-18 Mike H. Benton (bik...@us...) *src/output.c (addrow): Overhaul to fix memeory leak. (desc): Fix to support fix memory leak. --- 31,35 ---- ! 2004-04-18 Mike H. Benton (bik...@us...) *src/output.c (addrow): Overhaul to fix memeory leak. (desc): Fix to support fix memory leak. *************** *** 29,33 **** ! 2004-05-18 Mike H. Benton (bik...@us...) *src/statistics.c (stats_main): Moved and implement verified ability. Implemented calls to more statistical functions in libmistat. --- 42,46 ---- ! 2004-04-18 Mike H. Benton (bik...@us...) *src/statistics.c (stats_main): Moved and implement verified ability. Implemented calls to more statistical functions in libmistat. |
|
From: Mike H. B. <bik...@us...> - 2004-05-05 08:12:04
|
Update of /cvsroot/mistat/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12331 Modified Files: index.html Log Message: Changed bug stuff. Index: index.html =================================================================== RCS file: /cvsroot/mistat/website/index.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** index.html 22 Mar 2004 13:52:16 -0000 1.10 --- index.html 5 May 2004 08:11:52 -0000 1.11 *************** *** 17,21 **** <p>mistat is a statistical program for use on Linux that <b> will</b> use commands from several popular statistical ! packages, and uses the GNU Scientific Library (GSL).</p> <p><a --- 17,22 ---- <p>mistat is a statistical program for use on Linux that <b> will</b> use commands from several popular statistical ! packages, and uses the associated <a ! href="http://libmistat.sourceforge.net">libmistat</a>.</p> <p><a *************** *** 28,53 **** Donate to mistat</a></b></p> ! <h2>mistat Current Information (3/22/2004)</h2> ! <p>So, I am a little frustrated with GSL. It is fantastic, ! but too much and too little for a statistical package. For ! example, the need to send vectors and matrixes to the ! statistical routines and so on. So, I am of the library land ! to come up with some of my own stuff. Perhaps I should lie ! down before making this decision...</p> <p>The output is still being overhauled. Several other functions have been reworked to support this. Only basic ! descriptives are supported and the output is not that good.</p> <h3><a href="http://sourceforge.net/project/showfiles.php?group_id=87816"> ! First Release!</a></h3> <p>It is just part of the pre-alpha work. You will find the regression is pretty solid. And you will find the output is to be desired. Lastly, I have not been doing testing on ! Slackware. But, all has worked fine on Cygwin.</p> <p>The nightly <a id="mistat-tarball" --- 29,56 ---- Donate to mistat</a></b></p> ! <h2>mistat Current Information (4/5/2004)</h2> ! <p>I have started the dual conversion to libmistat and ! updating functions in the statistics.c. So far, mean and ! variance are back. As functions are added and tested in ! libmistat, I will update mistat. My goal is to have all basic ! descriptive's back in a week.</p> <p>The output is still being overhauled. Several other functions have been reworked to support this. Only basic ! descriptive's are supported and the output is not that good.</p> <h3><a href="http://sourceforge.net/project/showfiles.php?group_id=87816"> ! First Release (requires GSL v. 1.3 or greater)!</a></h3> <p>It is just part of the pre-alpha work. You will find the regression is pretty solid. And you will find the output is to be desired. Lastly, I have not been doing testing on ! Slackware. But, all has worked fine on Cygwin and the compile ! farm.</p> ! ! <h3>Other Information</h3> <p>The nightly <a id="mistat-tarball" *************** *** 55,61 **** name="mistat-tarball">tarball</a>.</p> ! <p>Martin Shepherd updated <a ! href="http://www.astro.caltech.edu/~mcs/tecla/index.html"> ! tecla</a> to v. 1.5.0 and so have I.</p> <h3>Functions Update</h3> --- 58,66 ---- name="mistat-tarball">tarball</a>.</p> ! <p>The <a id="libtecla" ! href="http://www.astro.caltech.edu/~mcs/tecla/index.html" ! name="libtecla">tecla command-line editing library</a> (v. ! 1.5.0) by Martin Shepherd is used for input. It compiles well ! in Slackware and Cygwin.</p> <h3>Functions Update</h3> *************** *** 65,85 **** <li style="list-style: none"> ! <p>No major prolems. Large data set processing can be ! slow with meadian because of the sorting process. At ! about 50,000 cases is where I noticed a change in ! processing time.</p> ! </li> ! ! <li>t-test</li> ! ! <li style="list-style: none"> ! <p>NEW! Need to generate tables and p</p> ! </li> ! ! <li>Simple Regression</li> ! ! <li style="list-style: none"> ! <p>The table needs improved, and residuals need ! plotted.</p> </li> </ul> --- 70,74 ---- <li style="list-style: none"> ! <p>Just the basic stuff</p> </li> </ul> *************** *** 87,123 **** <h3>Know Bugs</h3> ! <p>There are a few bugs. The file name disappears when the ! file menu gets used. However, no problems occur with this ! bug. The rest are features for my use:D</p> ! ! <h3>Other news</h3> ! ! <p>I am in South Korea, and working. However, I will now be ! able to get back to work on mistat. Right now I am trying to ! figure out what I was doing :D As a side note: the web site ! (page) is now in CVS.</p> ! ! <p>In an effort to minimize limits on the number of variables ! or cases in an input file, I am using the gsl_matrix and ! gsl_vector types. This lead to a problem with using the ! gsl_statistic routines as well as the linear functions. ! However, these functions do have limits themselves so ! all-in-all there should be not problem with the lack of ! gsl_statistics and gsl_linear. I have added a simple ! regression that provides basic output. A 20,000 case ! regression on Cygwin AMD Duron (1.4) with 512mb took about 1 ! second to compute the regression. Formula streamlining will ! take place later.</p> ! ! <p>The <a id="libtecla" ! href="http://www.astro.caltech.edu/~mcs/tecla/index.html" ! name="libtecla">tecla command-line editing library</a> (v. ! 1.5.0) by Martin Shepherd is used for input. It compiles well ! in Slackware and Cygwin.</p> <h3>Other points</h3> <ul type="disc"> ! <li>Reads data as double.</li> <li>Only does numeric data.</li> --- 76,85 ---- <h3>Know Bugs</h3> ! <p>There are quite a few bugs--but it is not even alpha time!:D</p> <h3>Other points</h3> <ul type="disc"> ! <li>Reads data as integer.</li> <li>Only does numeric data.</li> *************** *** 146,150 **** </li> ! <li>Natural Language: <a href="http://sourceforge.net"> English</a><br /> </li> --- 108,113 ---- </li> ! <li>Natural Language: <a ! href="http://sourceforge.net/softwaremap/trove_list.php?form_cat=275"> English</a><br /> </li> *************** *** 245,249 **** <img src="http://www.opensource.org/trademarks/opensource/web/opensource-110x95.png" ! border="0" width="110" height="95" /></a></p> </body> ! </html> --- 208,213 ---- <img src="http://www.opensource.org/trademarks/opensource/web/opensource-110x95.png" ! border="0" width="110" height="95" ! alt="OpenSource.org Logo" /></a></p> </body> ! </html> \ No newline at end of file |
|
From: Mike H. B. <bik...@us...> - 2004-05-05 08:05:53
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11160/src Modified Files: main.c main.h menu.c Log Message: Fixed problem with the loss of datafile name. Index: main.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** main.c 30 Mar 2004 15:49:48 -0000 1.11 --- main.c 5 May 2004 08:05:43 -0000 1.12 *************** *** 1,17 **** /* Entry point for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 --- 1,17 ---- /* Entry point for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! 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 *************** *** 65,69 **** static struct gengetopt_args_info args_info; /*command line structure */ bool data_file_exist; /*flag to indicate data file can be opened */ ! char *data_file_name; /*holds name of the data file */ int print_digit; /*Number of digits to print. */ GetLine *gl; /*For libtecla GetLine functions. */ --- 65,69 ---- static struct gengetopt_args_info args_info; /*command line structure */ bool data_file_exist; /*flag to indicate data file can be opened */ ! char data_file_name[MAXFILENAME]; /* Name of data file. */ int print_digit; /*Number of digits to print. */ GetLine *gl; /*For libtecla GetLine functions. */ *************** *** 80,89 **** set_signals (); - /*Turn off gsl error handler. */ - /*This will allow to use custom error handler. */ - /*gsl_error aborts on error and may not be necessary. */ - /*See Error Handling in gsl reference. */ - /*gsl_set_error_handler_off ();*/ - /*Need to make sure gl not initialized! */ /*Otherwise, need to make it so. */ --- 80,83 ---- *************** *** 102,107 **** do_args (argc, argv); ! /*Off to process land. We shall not return here! ! *The problem is a SEG violations becasue argc and argv get lost.*/ menu_main (); --- 96,100 ---- do_args (argc, argv); ! /* Off to process land. We shall not return here! */ menu_main (); *************** *** 224,231 **** else { ! data_file_name = *args_info.inputs; ! /*Hmmmmm...this stopped working and gave SEGV */ ! /*Now do above */ ! /*strcpy (data_file_name, *args_info.inputs); */ data_file = open_file (data_file_name, 1); --- 217,223 ---- else { ! ! strcpy (data_file_name, *args_info.inputs); ! data_file = open_file (data_file_name, 1); Index: menu.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/menu.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** menu.c 17 Apr 2004 15:36:38 -0000 1.20 --- menu.c 5 May 2004 08:05:43 -0000 1.21 *************** *** 18,34 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ ! /*USAGE: Call menu_main. Exit from mistat is from menu_main as well. FIXME: some file ops are here!*/ /*menu.c*/ ! #include <stdio.h> /* Various printf and some file stuff (for the moment). */ ! #include <ctype.h> #include <stdlib.h> ! #include <string.h> /* Some string minipulations. */ /*Use -ltecla for linking*/ ! #include <libtecla.h> /* Use for input. */ #include "menu.h" --- 18,34 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ ! /*USAGE: Call menu_main. Exit from mistat is from menu_main as well. FIXME: some file ops are here!*/ /*menu.c*/ ! #include <stdio.h> /* Various printf and some file stuff (for the moment). */ ! #include <ctype.h> #include <stdlib.h> ! #include <string.h> /* Some string minipulations. */ /*Use -ltecla for linking*/ ! #include <libtecla.h> /* Use for input. */ #include "menu.h" *************** *** 66,72 **** { choice = get_choice (main_menu, MIN_MENU, MAX_MENU); ! if (choice >= 2) ! do_menu_choice (choice); } --- 66,72 ---- { choice = get_choice (main_menu, MIN_MENU, MAX_MENU); ! if (choice >= 2) ! do_menu_choice (choice); } *************** *** 106,110 **** do_stats_choice (choice); ! break; --- 106,110 ---- do_stats_choice (choice); ! break; *************** *** 121,128 **** if (log_file_flag) view_log_file (); ! else printf ("Log file not open. Use -l in the command line to open\n\n"); ! break; --- 121,128 ---- if (log_file_flag) view_log_file (); ! else printf ("Log file not open. Use -l in the command line to open\n\n"); ! break; *************** *** 217,220 **** --- 217,222 ---- do_file_menu (int not_read) { + char *temp; + /*Close open data file if necessary. */ if (data_file_exist) *************** *** 225,232 **** ! data_file_name = gl_get_line (gl, "Enter the name of a file or Enter for none->", NULL, -1); /*Determine if user just hit Enter. */ if (strlen (data_file_name) <= 1) --- 227,236 ---- ! temp = gl_get_line (gl, "Enter the name of a file or Enter for none->", NULL, -1); + strcpy (data_file_name, temp); + /*Determine if user just hit Enter. */ if (strlen (data_file_name) <= 1) *************** *** 266,270 **** * Returns a verified choice. * -1 is a return and -2 indicates a negative number ! * -999 indicates character or choice. * or invalid selection for variable input. * Supply menu_number based on enum, min, and max possible values. --- 270,274 ---- * Returns a verified choice. * -1 is a return and -2 indicates a negative number ! * -999 indicates character or choice. * or invalid selection for variable input. * Supply menu_number based on enum, min, and max possible values. *************** *** 352,357 **** /* ! * Check if digits is within allowable values. ! * The various switch parts do addition to choice. */ if (digits == 0 && menu_number != options_menu) --- 356,361 ---- /* ! * Check if digits is within allowable values. ! * The various switch parts do addition to choice. */ if (digits == 0 && menu_number != options_menu) Index: main.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** main.h 15 Mar 2004 15:07:26 -0000 1.9 --- main.h 5 May 2004 08:05:43 -0000 1.10 *************** *** 25,28 **** --- 25,34 ---- /* + * Defines + */ + + #define MAXFILENAME 100 + + /* * Prototypes */ *************** *** 35,39 **** FILE *logfile; extern int print_digit; ! extern char *data_file_name; #endif --- 41,46 ---- FILE *logfile; extern int print_digit; ! extern char *ptr_data_file_name; ! extern char data_file_name[]; #endif |
|
From: Mike H. B. <bik...@us...> - 2004-05-05 08:05:52
|
Update of /cvsroot/mistat/mistat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11160 Modified Files: ChangeLog Log Message: Fixed problem with the loss of datafile name. Index: ChangeLog =================================================================== RCS file: /cvsroot/mistat/mistat/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ChangeLog 25 Apr 2004 22:30:42 -0000 1.16 --- ChangeLog 5 May 2004 08:05:42 -0000 1.17 *************** *** 1,2 **** --- 1,10 ---- + 2004-05-05 Mike H. Benton (bik...@us...) + *src/main.c: Fixed problem with the loss of data_file_name. + (get_data_file): Update. + Did some housekeeping. + *src/main.h: Added MAXFILENAME. + *src/menu.c (do_file_menu): Update. + + 2004-05-26 Mike H. Benton (bik...@us...) *src/cmdline.c |
|
From: Mike H. B. <bik...@us...> - 2004-04-25 22:30:59
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10634/src Modified Files: Makefile.in cmdline.c cmdline.h output.c statistics.c statistics.h Log Message: gengetopt version 2.12.1 updates. Index: statistics.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** statistics.c 19 Apr 2004 16:17:11 -0000 1.28 --- statistics.c 25 Apr 2004 22:30:44 -0000 1.29 *************** *** 89,92 **** --- 89,93 ---- long double temp, temp1; long double mean, variance, skewness, kurtosis; + int sum; *************** *** 96,100 **** if (is_vector) /*Just get moments for one variable. */ { ! mean = mean_int_vector (vta, index, nrows); variance = var_int_vector (vta, &mean, index, nrows); skewness = skewness_int_vector (vta, &variance, &mean, nrows); --- 97,101 ---- if (is_vector) /*Just get moments for one variable. */ { ! mean = mean_int_vector (vta, index, nrows, &sum); variance = var_int_vector (vta, &mean, index, nrows); skewness = skewness_int_vector (vta, &variance, &mean, nrows); *************** *** 104,108 **** else /*Get moments from matrix. */ { ! mean = mean_int_matrix (mta, index, nrows); variance = var_int_matrix (mta, &mean, index, nrows); skewness = skewness_int_matrix (mta, index, &variance, &mean, nrows); --- 105,109 ---- else /*Get moments from matrix. */ { ! mean = mean_int_matrix (mta, index, nrows, &sum); variance = var_int_matrix (mta, &mean, index, nrows); skewness = skewness_int_matrix (mta, index, &variance, &mean, nrows); *************** *** 114,117 **** --- 115,119 ---- D_STATS.skewness = skewness; D_STATS.kurtosis = kurtosis; + D_STATS.sum = sum; } *************** *** 123,127 **** get_sorted_stats (bool is_vector, int index) { ! long double median, min, max; if (is_vector) /*Process vector data. */ --- 125,129 ---- get_sorted_stats (bool is_vector, int index) { ! long double median, min, max, l_quart, u_quart; if (is_vector) /*Process vector data. */ *************** *** 131,134 **** --- 133,137 ---- q_sort_int_vector (vta, 1, nrows); median = median_int_vector (vta, nrows); + quartiles_int_vector (vta, nrows, &l_quart, &u_quart); } *************** *** 140,145 **** q_sort_int_matrix (mta, index, 1, nrows); median = median_int_matrix (mta, index, nrows); ! ! } --- 143,147 ---- q_sort_int_matrix (mta, index, 1, nrows); median = median_int_matrix (mta, index, nrows); ! quartiles_int_matrix (mta, index, nrows, &l_quart, &u_quart); } *************** *** 147,150 **** --- 149,155 ---- S_STATS.max = max; S_STATS.median = median; + S_STATS.l_quart = l_quart; + S_STATS.u_quart = u_quart; + S_STATS.iqr = (u_quart - l_quart); } Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** output.c 18 Apr 2004 14:02:25 -0000 1.22 --- output.c 25 Apr 2004 22:30:43 -0000 1.23 *************** *** 149,155 **** printf ! (" mean = %f\n skew = %f\n kur = %f\n var = %f\n median = %f\n min = %f\n max = %f\n", ! D_STATS.mean, D_STATS.skewness, D_STATS.kurtosis, D_STATS.variance, ! S_STATS.median, S_STATS.min, S_STATS.max); } --- 149,156 ---- printf ! (" mean = %f\n skew = %f\n kur = %f\n var = %f\n sum = %f\n median = %f\n min = %f\n max = %f\n lower = %f\n higher = %f\n iqr = %f\n\n", ! D_STATS.mean, D_STATS.skewness, D_STATS.kurtosis, ! D_STATS.variance, D_STATS.sum, S_STATS.median, S_STATS.min, ! S_STATS.max, S_STATS.l_quart, S_STATS.u_quart, S_STATS.iqr); } *************** *** 165,171 **** get_sorted_stats (is_vector, i); printf ! (" mean = %f\n skew = %f\n kur = %f\n var = %f\n\n median = %f\n min = %f\n max = %f\n", D_STATS.mean, D_STATS.skewness, D_STATS.kurtosis, ! D_STATS.variance, S_STATS.median, S_STATS.min, S_STATS.max); } } --- 166,174 ---- get_sorted_stats (is_vector, i); printf ! (" mean = %f\n skew = %f\n kur = %f\n var = %f\n sum = %f\n median = %f\n min = %f\n max = %f\n lower = %f\n higher = %f\n iqr = %f\n\n", D_STATS.mean, D_STATS.skewness, D_STATS.kurtosis, ! D_STATS.variance, D_STATS.sum, S_STATS.median, ! S_STATS.min, S_STATS.max, S_STATS.l_quart, ! S_STATS.u_quart, S_STATS.iqr); } } Index: cmdline.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/cmdline.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cmdline.h 16 Mar 2004 14:53:39 -0000 1.5 --- cmdline.h 25 Apr 2004 22:30:43 -0000 1.6 *************** *** 1,5 **** /* cmdline.h */ ! /* File autogenerated by gengetopt version 2.10 */ #ifndef CMDLINE_H --- 1,5 ---- /* cmdline.h */ ! /* File autogenerated by gengetopt version 2.12.1 */ #ifndef CMDLINE_H *************** *** 44,51 **** --- 44,57 ---- int cmdline_parser (int argc, char *const *argv, struct gengetopt_args_info *args_info); + int cmdline_parser2 (int argc, char *const *argv, + struct gengetopt_args_info *args_info, int override, + int initialize, int check_required); void cmdline_parser_print_help (void); void cmdline_parser_print_version (void); + void cmdline_parser_init (struct gengetopt_args_info *args_info); + void cmdline_parser_free (struct gengetopt_args_info *args_info); + #ifdef __cplusplus } Index: Makefile.in =================================================================== RCS file: /cvsroot/mistat/mistat/src/Makefile.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.in 18 Apr 2004 14:02:25 -0000 1.10 --- Makefile.in 25 Apr 2004 22:30:43 -0000 1.11 *************** *** 1,6 **** ! # Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ ! # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation --- 1,6 ---- ! # Makefile.in generated by automake 1.8 from Makefile.am. # @configure_input@ ! # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation *************** *** 35,38 **** --- 35,40 ---- # Process with automake to produce Makefile.in. + SOURCES = $(mistat_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ *************** *** 42,46 **** pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ --- 44,47 ---- *************** *** 56,59 **** --- 57,94 ---- PRE_UNINSTALL = : POST_UNINSTALL = : + bin_PROGRAMS = mistat$(EXEEXT) + subdir = src + DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/configure.ac + am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) + mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs + CONFIG_HEADER = $(top_builddir)/config.h + CONFIG_CLEAN_FILES = + am__installdirs = $(DESTDIR)$(bindir) + binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) + PROGRAMS = $(bin_PROGRAMS) + am_mistat_OBJECTS = cmdline.$(OBJEXT) error.$(OBJEXT) \ + file_ops.$(OBJEXT) main.$(OBJEXT) menu.$(OBJEXT) \ + output.$(OBJEXT) statistics.$(OBJEXT) memwatch.$(OBJEXT) + mistat_OBJECTS = $(am_mistat_OBJECTS) + mistat_LDADD = $(LDADD) + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) + depcomp = $(SHELL) $(top_srcdir)/config/depcomp + am__depfiles_maybe = depfiles + @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmdline.Po ./$(DEPDIR)/error.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/file_ops.Po ./$(DEPDIR)/main.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/memwatch.Po ./$(DEPDIR)/menu.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/statistics.Po + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + CCLD = $(CC) + LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + SOURCES = $(mistat_SOURCES) + DIST_SOURCES = $(mistat_SOURCES) + ETAGS = etags + CTAGS = ctags + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ *************** *** 124,174 **** sysconfdir = @sysconfdir@ target_alias = @target_alias@ - - bin_PROGRAMS = mistat mistat_SOURCES = cmdline.c error.c file_ops.c main.c menu.c output.c statistics.c cmdline.h error.h file_ops.h main.h menu.h output.h statistics.h system.h memwatch.c - subdir = src - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs - CONFIG_HEADER = $(top_builddir)/config.h - CONFIG_CLEAN_FILES = - bin_PROGRAMS = mistat$(EXEEXT) - PROGRAMS = $(bin_PROGRAMS) - - am_mistat_OBJECTS = cmdline.$(OBJEXT) error.$(OBJEXT) file_ops.$(OBJEXT) \ - main.$(OBJEXT) menu.$(OBJEXT) output.$(OBJEXT) \ - statistics.$(OBJEXT) memwatch.$(OBJEXT) - mistat_OBJECTS = $(am_mistat_OBJECTS) - mistat_LDADD = $(LDADD) - mistat_DEPENDENCIES = - mistat_LDFLAGS = - - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) - depcomp = $(SHELL) $(top_srcdir)/config/depcomp - am__depfiles_maybe = depfiles - @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmdline.Po ./$(DEPDIR)/error.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/file_ops.Po ./$(DEPDIR)/main.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/memwatch.Po ./$(DEPDIR)/menu.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/statistics.Po - COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - CCLD = $(CC) - LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ - DIST_SOURCES = $(mistat_SOURCES) - DIST_COMMON = $(srcdir)/Makefile.in Makefile.am - SOURCES = $(mistat_SOURCES) - all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj ! $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile ! Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ! cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) ! binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) ! $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ --- 159,199 ---- sysconfdir = @sysconfdir@ target_alias = @target_alias@ mistat_SOURCES = cmdline.c error.c file_ops.c main.c menu.c output.c statistics.c cmdline.h error.h file_ops.h main.h menu.h output.h statistics.h system.h memwatch.c all: all-am .SUFFIXES: .SUFFIXES: .c .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 \ ! && exit 0; \ ! exit 1;; \ ! esac; \ ! done; \ ! echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile ! .PRECIOUS: 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__depfiles_maybe)'; \ ! cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ ! 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 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) ! $(mkdir_p) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ *************** *** 196,200 **** mostlyclean-compile: ! -rm -f *.$(OBJEXT) core *.core distclean-compile: --- 221,225 ---- mostlyclean-compile: ! -rm -f *.$(OBJEXT) distclean-compile: *************** *** 211,244 **** .c.o: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ ! @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ ! @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ ! @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ ! @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ ! @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ ! @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: - ETAGS = etags - ETAGSFLAGS = - - CTAGS = ctags - CTAGSFLAGS = - - tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ --- 236,255 ---- .c.o: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ *************** *** 249,252 **** --- 260,264 ---- END { for (i in files) print i; }'`; \ mkid -fID $$unique + tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ *************** *** 263,267 **** || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique - ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ --- 275,278 ---- *************** *** 286,293 **** distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - - top_distdir = .. - distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) --- 297,300 ---- *************** *** 303,307 **** if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ ! $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ --- 310,314 ---- if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ ! $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ *************** *** 321,327 **** check: check-am all-am: Makefile $(PROGRAMS) - installdirs: ! $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-am install-exec: install-exec-am --- 328,333 ---- check: check-am all-am: Makefile $(PROGRAMS) installdirs: ! $(mkdir_p) $(DESTDIR)$(bindir) install: install-am install-exec: install-exec-am *************** *** 362,365 **** --- 368,373 ---- dvi-am: + html: html-am + info: info-am *************** *** 397,405 **** .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ ! distclean-generic distclean-tags distdir dvi dvi-am info \ ! info-am install install-am install-binPROGRAMS install-data \ ! install-data-am install-exec install-exec-am install-info \ ! install-info-am install-man install-strip installcheck \ ! installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ --- 405,413 ---- .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ ! distclean-generic distclean-tags distdir dvi dvi-am html \ ! html-am info info-am install install-am install-binPROGRAMS \ ! install-data install-data-am install-exec install-exec-am \ ! install-info install-info-am install-man install-strip \ ! installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ Index: statistics.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** statistics.h 30 Mar 2004 15:49:48 -0000 1.16 --- statistics.h 25 Apr 2004 22:30:44 -0000 1.17 *************** *** 35,38 **** --- 35,39 ---- double kurtosis; double variance; + double sum; } D_STATS; *************** *** 45,48 **** --- 46,52 ---- double upper_tail; double lower_tail; + double l_quart; + double u_quart; + double iqr; } S_STATS; Index: cmdline.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/cmdline.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cmdline.c 16 Mar 2004 14:53:10 -0000 1.6 --- cmdline.c 25 Apr 2004 22:30:43 -0000 1.7 *************** *** 1,7 **** /* ! File autogenerated by gengetopt version 2.10 generated with the following command: gengetopt --input=mistat.ggo -u ! The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: --- 1,7 ---- /* ! File autogenerated by gengetopt version 2.12.1 generated with the following command: gengetopt --input=mistat.ggo -u ! The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: *************** *** 9,17 **** */ - - #include <stdio.h> - #include <stdlib.h> - #include <string.h> - /* If we use autoconf. */ #ifdef HAVE_CONFIG_H --- 9,12 ---- *************** *** 19,26 **** --- 14,56 ---- #endif + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + #include "getopt.h" #include "cmdline.h" + static void clear_given (struct gengetopt_args_info *args_info); + static void clear_args (struct gengetopt_args_info *args_info); + + static int + cmdline_parser_internal (int argc, char *const *argv, + struct gengetopt_args_info *args_info, int override, + int initialize, int check_required, + const char *additional_error); + + static char *gengetopt_strdup (const char *s); + + static void + clear_given (struct gengetopt_args_info *args_info) + { + args_info->help_given = 0; + args_info->version_given = 0; + args_info->nobell_given = 0; + args_info->digits_given = 0; + args_info->log_given = 0; + args_info->nofile_given = 0; + } + + static void + clear_args (struct gengetopt_args_info *args_info) + { + args_info->nobell_flag = 0; + args_info->digits_arg = 2; + args_info->log_flag = 0; + args_info->nofile_flag = 0; + } + void cmdline_parser_print_version (void) *************** *** 37,54 **** " mistat is a statistical program based on statist.\nCopyright (C) 2003 Mike H. Benton\nmistat comes with NO WARRANTY, \nto the extent permitted by law. \nYou may redistribute copies of mistat\nunder the terms of the GNU General Public License. \nFor more information about these matters, \nsee the files named COPYING. \n\n" "\n" "Usage: %s [OPTIONS]... [FILES]...\n", CMDLINE_PARSER_PACKAGE); ! printf (" -h --help Print help and exit\n"); ! printf (" -V --version Print version and exit\n"); ! printf ! (" -b --nobell No beeps on errors or warnings (default=off)\n"); ! printf ! (" -d --digits Number of digits to print (default='2')\n"); ! printf ! (" -l --log Write results to statist.log (default=off)\n"); ! printf ! (" -n --nofile Do not read data file on startup.\n\t\t\tData file must be specified from menu. (default=off)\n"); } - static char *gengetopt_strdup (const char *s); /* gengetopt_strdup() */ --- 67,108 ---- " mistat is a statistical program based on statist.\nCopyright (C) 2003 Mike H. Benton\nmistat comes with NO WARRANTY, \nto the extent permitted by law. \nYou may redistribute copies of mistat\nunder the terms of the GNU General Public License. \nFor more information about these matters, \nsee the files named COPYING. \n\n" "\n" "Usage: %s [OPTIONS]... [FILES]...\n", CMDLINE_PARSER_PACKAGE); ! printf ("\n"); ! printf ("%s\n", " -h, --help Print help and exit"); ! printf ("%s\n", " -V, --version Print version and exit"); ! printf ("%s\n", ! " -b, --nobell No beeps on errors or warnings (default=off)"); ! printf ("%s\n", ! " -d, --digits=INT Number of digits to print (default=`2')"); ! printf ("%s\n", ! " -l, --log Write results to statist.log (default=off)"); ! printf ("%s\n", ! " -n, --nofile Do not read data file on startup.\n\t\t\tData file must be specified from menu. (default=off)\n"); ! } ! ! void ! cmdline_parser_init (struct gengetopt_args_info *args_info) ! { ! clear_given (args_info); ! clear_args (args_info); ! ! args_info->inputs = NULL; ! args_info->inputs_num = 0; } + void + cmdline_parser_free (struct gengetopt_args_info *args_info) + { + + int i; + + for (i = 0; i < args_info->inputs_num; ++i) + free (args_info->inputs[i]); + + if (args_info->inputs_num) + free (args_info->inputs); + + clear_given (args_info); + } /* gengetopt_strdup() */ *************** *** 57,61 **** gengetopt_strdup (const char *s) { ! char *result = (char *) malloc (strlen (s) + 1); if (result == (char *) 0) return (char *) 0; --- 111,119 ---- gengetopt_strdup (const char *s) { ! char *result = NULL; ! if (!s) ! return result; ! ! result = (char *) malloc (strlen (s) + 1); if (result == (char *) 0) return (char *) 0; *************** *** 68,92 **** struct gengetopt_args_info *args_info) { ! int c; /* Character of the parsed option. */ ! int missing_required_options = 0; ! args_info->help_given = 0; ! args_info->version_given = 0; ! args_info->nobell_given = 0; ! args_info->digits_given = 0; ! args_info->log_given = 0; ! args_info->nofile_given = 0; ! #define clear_args() \ ! { \ ! args_info->nobell_flag = 0;\ ! args_info->digits_arg = 2 ;\ ! args_info->log_flag = 0;\ ! args_info->nofile_flag = 0;\ ! } ! clear_args (); ! args_info->inputs = NULL; ! args_info->inputs_num = 0; optarg = 0; --- 126,166 ---- struct gengetopt_args_info *args_info) { ! return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); ! } ! int ! cmdline_parser2 (int argc, char *const *argv, ! struct gengetopt_args_info *args_info, int override, ! int initialize, int check_required) ! { ! int result; ! result = ! cmdline_parser_internal (argc, argv, args_info, override, initialize, ! check_required, NULL); ! if (result == EXIT_FAILURE) ! { ! cmdline_parser_free (args_info); ! exit (EXIT_FAILURE); ! } ! ! return result; ! } ! ! int ! cmdline_parser_internal (int argc, char *const *argv, ! struct gengetopt_args_info *args_info, int override, ! int initialize, int check_required, ! const char *additional_error) ! { ! int c; /* Character of the parsed option. */ ! int error = 0; ! struct gengetopt_args_info local_args_info; ! ! if (initialize) ! cmdline_parser_init (args_info); ! ! cmdline_parser_init (&local_args_info); optarg = 0; *************** *** 121,142 **** { case 'h': /* Print help and exit. */ - clear_args (); cmdline_parser_print_help (); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ - clear_args (); cmdline_parser_print_version (); exit (EXIT_SUCCESS); case 'b': /* No beeps on errors or warnings. */ ! if (args_info->nobell_given) { fprintf (stderr, ! "%s: `--nobell' (`-b') option given more than once\n", ! CMDLINE_PARSER_PACKAGE); ! clear_args (); ! exit (EXIT_FAILURE); } args_info->nobell_given = 1; args_info->nobell_flag = !(args_info->nobell_flag); --- 195,217 ---- { case 'h': /* Print help and exit. */ cmdline_parser_print_help (); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ cmdline_parser_print_version (); exit (EXIT_SUCCESS); case 'b': /* No beeps on errors or warnings. */ ! if (local_args_info.nobell_given) { fprintf (stderr, ! "%s: `--nobell' (`-b') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } + if (args_info->nobell_given && !override) + continue; + local_args_info.nobell_given = 1; args_info->nobell_given = 1; args_info->nobell_flag = !(args_info->nobell_flag); *************** *** 144,155 **** case 'd': /* Number of digits to print. */ ! if (args_info->digits_given) { fprintf (stderr, ! "%s: `--digits' (`-d') option given more than once\n", ! CMDLINE_PARSER_PACKAGE); ! clear_args (); ! exit (EXIT_FAILURE); } args_info->digits_given = 1; args_info->digits_arg = strtol (optarg, &stop_char, 0); --- 219,233 ---- case 'd': /* Number of digits to print. */ ! if (local_args_info.digits_given) { fprintf (stderr, ! "%s: `--digits' (`-d') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } + if (args_info->digits_given && !override) + continue; + local_args_info.digits_given = 1; args_info->digits_given = 1; args_info->digits_arg = strtol (optarg, &stop_char, 0); *************** *** 157,168 **** case 'l': /* Write results to statist.log. */ ! if (args_info->log_given) { fprintf (stderr, ! "%s: `--log' (`-l') option given more than once\n", ! CMDLINE_PARSER_PACKAGE); ! clear_args (); ! exit (EXIT_FAILURE); } args_info->log_given = 1; args_info->log_flag = !(args_info->log_flag); --- 235,249 ---- case 'l': /* Write results to statist.log. */ ! if (local_args_info.log_given) { fprintf (stderr, ! "%s: `--log' (`-l') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } + if (args_info->log_given && !override) + continue; + local_args_info.log_given = 1; args_info->log_given = 1; args_info->log_flag = !(args_info->log_flag); *************** *** 170,181 **** case 'n': /* Do not read data file on startup.\n\t\t\tData file must be specified from menu.. */ ! if (args_info->nofile_given) { fprintf (stderr, ! "%s: `--nofile' (`-n') option given more than once\n", ! CMDLINE_PARSER_PACKAGE); ! clear_args (); ! exit (EXIT_FAILURE); } args_info->nofile_given = 1; args_info->nofile_flag = !(args_info->nofile_flag); --- 251,265 ---- case 'n': /* Do not read data file on startup.\n\t\t\tData file must be specified from menu.. */ ! if (local_args_info.nofile_given) { fprintf (stderr, ! "%s: `--nofile' (`-n') option given more than once%s\n", ! CMDLINE_PARSER_PACKAGE, ! (additional_error ? additional_error : "")); ! goto failure; } + if (args_info->nofile_given && !override) + continue; + local_args_info.nofile_given = 1; args_info->nofile_given = 1; args_info->nofile_flag = !(args_info->nofile_flag); *************** *** 187,195 **** case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ ! exit (EXIT_FAILURE); default: /* bug: option not considered. */ ! fprintf (stderr, "%s: option unknown: %c\n", CMDLINE_PARSER_PACKAGE, ! c); abort (); } /* switch */ --- 271,280 ---- case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ ! goto failure; default: /* bug: option not considered. */ ! fprintf (stderr, "%s: option unknown: %c%s\n", ! CMDLINE_PARSER_PACKAGE, c, ! (additional_error ? additional_error : "")); abort (); } /* switch */ *************** *** 197,202 **** ! if (missing_required_options) ! exit (EXIT_FAILURE); if (optind < argc) --- 282,291 ---- ! ! if (check_required) ! {} ! ! if (error) ! return (EXIT_FAILURE); if (optind < argc) *************** *** 221,225 **** } } - return 0; } --- 310,317 ---- } } return 0; + + failure: + cmdline_parser_free (&local_args_info); + return (EXIT_FAILURE); } |