summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjofret2008-06-02 08:07:26 +0000
committerjofret2008-06-02 08:07:26 +0000
commit8a52d403ff3765407921395748ff20884936fa17 (patch)
tree69d392e3c1cdc8954dcbc6c254925b60fe9d4946 /src
parent55835a35c68b51f68fec1ca1b996429e9cd99b3d (diff)
downloadscilab2c-8a52d403ff3765407921395748ff20884936fa17.tar.gz
scilab2c-8a52d403ff3765407921395748ff20884936fa17.tar.bz2
scilab2c-8a52d403ff3765407921395748ff20884936fa17.zip
Adding Sum function
Diffstat (limited to 'src')
-rw-r--r--src/statisticsFunctions/sum/Makefile.am54
-rw-r--r--src/statisticsFunctions/sum/Makefile.in671
-rw-r--r--src/statisticsFunctions/sum/csuma.c24
-rw-r--r--src/statisticsFunctions/sum/dsuma.c25
-rw-r--r--src/statisticsFunctions/sum/ssuma.c25
-rw-r--r--src/statisticsFunctions/sum/testDoubleSum.c106
-rw-r--r--src/statisticsFunctions/sum/testFloatSum.c104
-rw-r--r--src/statisticsFunctions/sum/zsuma.c24
8 files changed, 1033 insertions, 0 deletions
diff --git a/src/statisticsFunctions/sum/Makefile.am b/src/statisticsFunctions/sum/Makefile.am
new file mode 100644
index 00000000..2464d6e7
--- /dev/null
+++ b/src/statisticsFunctions/sum/Makefile.am
@@ -0,0 +1,54 @@
+##
+## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+## Copyright (C) 2006-2008 - INRIA - Bruno JOFRET
+##
+## This file must be used under the terms of the CeCILL.
+## This source file is licensed as described in the file COPYING, which
+## you should have received as part of this distribution. The terms
+## are also available at
+## http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+##
+##
+
+libSum_la_CFLAGS = -I $(top_builddir)/type \
+ -I ../includes
+
+instdir = $(top_builddir)/lib
+
+pkglib_LTLIBRARIES = libSum.la
+
+libSum_la_SOURCES = $(HEAD) $(SRC)
+
+SRC = ssuma.c \
+ dsuma.c \
+ csuma.c \
+ zsuma.c
+
+HEAD = ../includes/sum.h
+
+####
+# Checking Part
+####
+
+check_INCLUDES = -I $(top_builddir)/statisticsFunctions/includes \
+ -I $(top_builddir)/type
+
+check_LDADD = $(top_builddir)/type/libDoubleComplex.la \
+ $(top_builddir)/type/libFloatComplex.la \
+ $(top_builddir)/statisticsFunctions/sum/libSum.la \
+ @LIBMATH@
+
+check_PROGRAMS = testFloatSum testDoubleSum
+
+TESTS = testFloatSum testDoubleSum
+
+#
+# -*- Sum Tests -*-
+#
+testFloatSum_SOURCES = testFloatSum.c
+testFloatSum_CFLAGS = $(check_INCLUDES)
+testFloatSum_LDADD = $(check_LDADD)
+
+testDoubleSum_SOURCES =testDoubleSum.c
+testDoubleSum_CFLAGS = $(check_INCLUDES)
+testDoubleSum_LDADD = $(check_LDADD) \ No newline at end of file
diff --git a/src/statisticsFunctions/sum/Makefile.in b/src/statisticsFunctions/sum/Makefile.in
new file mode 100644
index 00000000..ae05e61b
--- /dev/null
+++ b/src/statisticsFunctions/sum/Makefile.in
@@ -0,0 +1,671 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = testFloatSum$(EXEEXT) testDoubleSum$(EXEEXT)
+TESTS = testFloatSum$(EXEEXT) testDoubleSum$(EXEEXT)
+subdir = statisticsFunctions/sum
+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 = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/includes/machine.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libSum_la_LIBADD =
+am__objects_1 =
+am__objects_2 = libSum_la-ssuma.lo libSum_la-dsuma.lo \
+ libSum_la-csuma.lo libSum_la-zsuma.lo
+am_libSum_la_OBJECTS = $(am__objects_1) $(am__objects_2)
+libSum_la_OBJECTS = $(am_libSum_la_OBJECTS)
+libSum_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libSum_la_CFLAGS) \
+ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+am_testDoubleSum_OBJECTS = testDoubleSum-testDoubleSum.$(OBJEXT)
+testDoubleSum_OBJECTS = $(am_testDoubleSum_OBJECTS)
+am__DEPENDENCIES_1 = $(top_builddir)/type/libDoubleComplex.la \
+ $(top_builddir)/type/libFloatComplex.la \
+ $(top_builddir)/statisticsFunctions/sum/libSum.la
+testDoubleSum_DEPENDENCIES = $(am__DEPENDENCIES_1)
+testDoubleSum_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleSum_CFLAGS) \
+ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+am_testFloatSum_OBJECTS = testFloatSum-testFloatSum.$(OBJEXT)
+testFloatSum_OBJECTS = $(am_testFloatSum_OBJECTS)
+testFloatSum_DEPENDENCIES = $(am__DEPENDENCIES_1)
+testFloatSum_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatSum_CFLAGS) \
+ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/includes
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libSum_la_SOURCES) $(testDoubleSum_SOURCES) \
+ $(testFloatSum_SOURCES)
+DIST_SOURCES = $(libSum_la_SOURCES) $(testDoubleSum_SOURCES) \
+ $(testFloatSum_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBMATH = @LIBMATH@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+libSum_la_CFLAGS = -I $(top_builddir)/type \
+ -I ../includes
+
+instdir = $(top_builddir)/lib
+pkglib_LTLIBRARIES = libSum.la
+libSum_la_SOURCES = $(HEAD) $(SRC)
+SRC = ssuma.c \
+ dsuma.c \
+ csuma.c \
+ zsuma.c
+
+HEAD = ../includes/sum.h
+
+####
+# Checking Part
+####
+check_INCLUDES = -I $(top_builddir)/statisticsFunctions/includes \
+ -I $(top_builddir)/type
+
+check_LDADD = $(top_builddir)/type/libDoubleComplex.la \
+ $(top_builddir)/type/libFloatComplex.la \
+ $(top_builddir)/statisticsFunctions/sum/libSum.la \
+ @LIBMATH@
+
+
+#
+# -*- Sum Tests -*-
+#
+testFloatSum_SOURCES = testFloatSum.c
+testFloatSum_CFLAGS = $(check_INCLUDES)
+testFloatSum_LDADD = $(check_LDADD)
+testDoubleSum_SOURCES = testDoubleSum.c
+testDoubleSum_CFLAGS = $(check_INCLUDES)
+testDoubleSum_LDADD = $(check_LDADD)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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) --foreign statisticsFunctions/sum/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign statisticsFunctions/sum/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-pkglibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+ done
+
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libSum.la: $(libSum_la_OBJECTS) $(libSum_la_DEPENDENCIES)
+ $(libSum_la_LINK) -rpath $(pkglibdir) $(libSum_la_OBJECTS) $(libSum_la_LIBADD) $(LIBS)
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+testDoubleSum$(EXEEXT): $(testDoubleSum_OBJECTS) $(testDoubleSum_DEPENDENCIES)
+ @rm -f testDoubleSum$(EXEEXT)
+ $(testDoubleSum_LINK) $(testDoubleSum_OBJECTS) $(testDoubleSum_LDADD) $(LIBS)
+testFloatSum$(EXEEXT): $(testFloatSum_OBJECTS) $(testFloatSum_DEPENDENCIES)
+ @rm -f testFloatSum$(EXEEXT)
+ $(testFloatSum_LINK) $(testFloatSum_OBJECTS) $(testFloatSum_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSum_la-csuma.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSum_la-dsuma.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSum_la-ssuma.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSum_la-zsuma.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleSum-testDoubleSum.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatSum-testFloatSum.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libSum_la-ssuma.lo: ssuma.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSum_la_CFLAGS) $(CFLAGS) -MT libSum_la-ssuma.lo -MD -MP -MF $(DEPDIR)/libSum_la-ssuma.Tpo -c -o libSum_la-ssuma.lo `test -f 'ssuma.c' || echo '$(srcdir)/'`ssuma.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libSum_la-ssuma.Tpo $(DEPDIR)/libSum_la-ssuma.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ssuma.c' object='libSum_la-ssuma.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSum_la_CFLAGS) $(CFLAGS) -c -o libSum_la-ssuma.lo `test -f 'ssuma.c' || echo '$(srcdir)/'`ssuma.c
+
+libSum_la-dsuma.lo: dsuma.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSum_la_CFLAGS) $(CFLAGS) -MT libSum_la-dsuma.lo -MD -MP -MF $(DEPDIR)/libSum_la-dsuma.Tpo -c -o libSum_la-dsuma.lo `test -f 'dsuma.c' || echo '$(srcdir)/'`dsuma.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libSum_la-dsuma.Tpo $(DEPDIR)/libSum_la-dsuma.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dsuma.c' object='libSum_la-dsuma.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSum_la_CFLAGS) $(CFLAGS) -c -o libSum_la-dsuma.lo `test -f 'dsuma.c' || echo '$(srcdir)/'`dsuma.c
+
+libSum_la-csuma.lo: csuma.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSum_la_CFLAGS) $(CFLAGS) -MT libSum_la-csuma.lo -MD -MP -MF $(DEPDIR)/libSum_la-csuma.Tpo -c -o libSum_la-csuma.lo `test -f 'csuma.c' || echo '$(srcdir)/'`csuma.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libSum_la-csuma.Tpo $(DEPDIR)/libSum_la-csuma.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='csuma.c' object='libSum_la-csuma.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSum_la_CFLAGS) $(CFLAGS) -c -o libSum_la-csuma.lo `test -f 'csuma.c' || echo '$(srcdir)/'`csuma.c
+
+libSum_la-zsuma.lo: zsuma.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSum_la_CFLAGS) $(CFLAGS) -MT libSum_la-zsuma.lo -MD -MP -MF $(DEPDIR)/libSum_la-zsuma.Tpo -c -o libSum_la-zsuma.lo `test -f 'zsuma.c' || echo '$(srcdir)/'`zsuma.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libSum_la-zsuma.Tpo $(DEPDIR)/libSum_la-zsuma.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zsuma.c' object='libSum_la-zsuma.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libSum_la_CFLAGS) $(CFLAGS) -c -o libSum_la-zsuma.lo `test -f 'zsuma.c' || echo '$(srcdir)/'`zsuma.c
+
+testDoubleSum-testDoubleSum.o: testDoubleSum.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSum_CFLAGS) $(CFLAGS) -MT testDoubleSum-testDoubleSum.o -MD -MP -MF $(DEPDIR)/testDoubleSum-testDoubleSum.Tpo -c -o testDoubleSum-testDoubleSum.o `test -f 'testDoubleSum.c' || echo '$(srcdir)/'`testDoubleSum.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleSum-testDoubleSum.Tpo $(DEPDIR)/testDoubleSum-testDoubleSum.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSum.c' object='testDoubleSum-testDoubleSum.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSum_CFLAGS) $(CFLAGS) -c -o testDoubleSum-testDoubleSum.o `test -f 'testDoubleSum.c' || echo '$(srcdir)/'`testDoubleSum.c
+
+testDoubleSum-testDoubleSum.obj: testDoubleSum.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSum_CFLAGS) $(CFLAGS) -MT testDoubleSum-testDoubleSum.obj -MD -MP -MF $(DEPDIR)/testDoubleSum-testDoubleSum.Tpo -c -o testDoubleSum-testDoubleSum.obj `if test -f 'testDoubleSum.c'; then $(CYGPATH_W) 'testDoubleSum.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSum.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleSum-testDoubleSum.Tpo $(DEPDIR)/testDoubleSum-testDoubleSum.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleSum.c' object='testDoubleSum-testDoubleSum.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleSum_CFLAGS) $(CFLAGS) -c -o testDoubleSum-testDoubleSum.obj `if test -f 'testDoubleSum.c'; then $(CYGPATH_W) 'testDoubleSum.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleSum.c'; fi`
+
+testFloatSum-testFloatSum.o: testFloatSum.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSum_CFLAGS) $(CFLAGS) -MT testFloatSum-testFloatSum.o -MD -MP -MF $(DEPDIR)/testFloatSum-testFloatSum.Tpo -c -o testFloatSum-testFloatSum.o `test -f 'testFloatSum.c' || echo '$(srcdir)/'`testFloatSum.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatSum-testFloatSum.Tpo $(DEPDIR)/testFloatSum-testFloatSum.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSum.c' object='testFloatSum-testFloatSum.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSum_CFLAGS) $(CFLAGS) -c -o testFloatSum-testFloatSum.o `test -f 'testFloatSum.c' || echo '$(srcdir)/'`testFloatSum.c
+
+testFloatSum-testFloatSum.obj: testFloatSum.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSum_CFLAGS) $(CFLAGS) -MT testFloatSum-testFloatSum.obj -MD -MP -MF $(DEPDIR)/testFloatSum-testFloatSum.Tpo -c -o testFloatSum-testFloatSum.obj `if test -f 'testFloatSum.c'; then $(CYGPATH_W) 'testFloatSum.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSum.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatSum-testFloatSum.Tpo $(DEPDIR)/testFloatSum-testFloatSum.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatSum.c' object='testFloatSum-testFloatSum.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatSum_CFLAGS) $(CFLAGS) -c -o testFloatSum-testFloatSum.obj `if test -f 'testFloatSum.c'; then $(CYGPATH_W) 'testFloatSum.c'; else $(CYGPATH_W) '$(srcdir)/testFloatSum.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(pkglibdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ clean-pkglibLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool \
+ clean-pkglibLTLIBRARIES ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-pkglibLTLIBRARIES install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/statisticsFunctions/sum/csuma.c b/src/statisticsFunctions/sum/csuma.c
new file mode 100644
index 00000000..68ebb291
--- /dev/null
+++ b/src/statisticsFunctions/sum/csuma.c
@@ -0,0 +1,24 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "sum.h"
+
+floatComplex csuma(floatComplex *in, int size) {
+ floatComplex accumulate = FloatComplex(0.0f, 0.0f);
+ int i = 0;
+
+ for (i = 0; i < size; ++i)
+ {
+ accumulate = cadds(accumulate, in[i]);
+ }
+ return accumulate;
+}
diff --git a/src/statisticsFunctions/sum/dsuma.c b/src/statisticsFunctions/sum/dsuma.c
new file mode 100644
index 00000000..eddceb6f
--- /dev/null
+++ b/src/statisticsFunctions/sum/dsuma.c
@@ -0,0 +1,25 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "sum.h"
+
+double dsuma(double *in, int size) {
+ double accumulate = 0.0;
+ int i = 0;
+
+ for (i = 0; i < size; ++i)
+ {
+ accumulate += in[i];
+ }
+ return accumulate;
+
+}
diff --git a/src/statisticsFunctions/sum/ssuma.c b/src/statisticsFunctions/sum/ssuma.c
new file mode 100644
index 00000000..aabc7fe0
--- /dev/null
+++ b/src/statisticsFunctions/sum/ssuma.c
@@ -0,0 +1,25 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "sum.h"
+
+float ssuma(float *in, int size) {
+ float accumulate = 0.0f;
+ int i = 0;
+
+ for (i = 0; i < size; ++i)
+ {
+ accumulate += in[i];
+ }
+ return accumulate;
+
+}
diff --git a/src/statisticsFunctions/sum/testDoubleSum.c b/src/statisticsFunctions/sum/testDoubleSum.c
new file mode 100644
index 00000000..59ba295b
--- /dev/null
+++ b/src/statisticsFunctions/sum/testDoubleSum.c
@@ -0,0 +1,106 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include "sum.h"
+
+/* #define LOCAL_DEBUG */
+
+static int dsumsTest(void) {
+ double value1 = 3.0f;
+ double value2 = 1.123456789f;
+
+ assert(dsums(value1) == 3.0f);
+ assert(dsums(value2) == 1.123456789f);
+ return 0;
+}
+
+static int dsumaTest(void) {
+ double table1[3] = {3.0, 3.0, 3.0};
+ double table2[5] = {9.186784563,
+ 9.186784563,
+ 9.186784563,
+ 9.186784563,
+ 9.186784563};
+
+ assert(dsuma(table1, 3) == 9.0);
+#ifdef LOCAL_DEBUG
+ printf("%e\n", dsuma(table2, 5));
+ printf("%e\n", 9.186784563 + 9.186784563 + 9.186784563 + 9.186784563 + 9.186784563);
+ printf("%e\n", (dsuma(table2, 5) - (9.186784563 + 9.186784563 + 9.186784563 + 9.186784563 + 9.186784563)) / dsuma(table2, 5));
+#endif
+ assert((dsuma(table2, 5) - (9.186784563 + 9.186784563 + 9.186784563 + 9.186784563 + 9.186784563)) / dsuma(table2, 5) == 0.0);
+ return 0;
+}
+
+static int zsumsTest(void) {
+ doubleComplex value1 = DoubleComplex(3.0, 3.0);
+ doubleComplex value2 = DoubleComplex(1.123456789, 1.123456789);
+
+ assert(zreals(zsums(value1)) == 3.0);
+ assert(zimags(zsums(value1)) == 3.0);
+ assert(zreals(zsums(value2)) == 1.123456789);
+ assert(zimags(zsums(value2)) == 1.123456789);
+ return 0;
+}
+
+static int zsumaTest(void) {
+ doubleComplex value1 = DoubleComplex(3.0, 3.0);
+ doubleComplex table1[3];
+ doubleComplex value2 = DoubleComplex(9.186784563, 9.186784563);
+ doubleComplex table2[5];
+
+ table1[0] = value1;
+ table1[1] = value1;
+ table1[2] = value1;
+
+ table2[0] = value2;
+ table2[1] = value2;
+ table2[2] = value2;
+ table2[3] = value2;
+ table2[4] = value2;
+
+#ifdef LOCAL_DEBUG
+ printf("--------\n");
+ printf("%e\n", zimags(zsuma(table1, 3)));
+ printf("%e\n", zreals(zsuma(table2, 5)));
+ printf("%e\n", zimags(zsuma(table2, 5)));
+ printf("%e\n", zreals(zsuma(table2, 5)));
+ printf("%e\n", zimags(zsuma(table2, 5)));
+ printf("--------\n");
+#endif
+ assert(zreals(zsuma(table1, 3)) == 9.0);
+ assert(zimags(zsuma(table1, 3)) == 9.0);
+ assert(zreals(zsuma(table2, 5)) == (9.186784563 + 9.186784563 + 9.186784563 + 9.186784563 + 9.186784563));
+ assert(zimags(zsuma(table2, 5)) == (9.186784563 + 9.186784563 + 9.186784563 + 9.186784563 + 9.186784563));
+
+ return 0;
+}
+
+static int testSum(void) {
+
+ printf("\n>>>> Sum Tests\n");
+ dsumsTest();
+ dsumaTest();
+ zsumsTest();
+ zsumaTest();
+
+ return 0;
+}
+
+
+
+int main(void) {
+ assert(testSum() == 0);
+ return 0;
+}
diff --git a/src/statisticsFunctions/sum/testFloatSum.c b/src/statisticsFunctions/sum/testFloatSum.c
new file mode 100644
index 00000000..45c11419
--- /dev/null
+++ b/src/statisticsFunctions/sum/testFloatSum.c
@@ -0,0 +1,104 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include "sum.h"
+
+/* #define LOCAL_DEBUG */
+
+static int ssumsTest(void) {
+ float value1 = 3.0f;
+ float value2 = 1.123456789f;
+
+ assert(ssums(value1) == 3.0f);
+ assert(ssums(value2) == 1.123456789f);
+ return 0;
+}
+
+static int ssumaTest(void) {
+ float table1[3] = {3.0f, 3.0f, 3.0f};
+ float table2[5] = {9.186784563f,
+ 9.186784563f,
+ 9.186784563f,
+ 9.186784563f,
+ 9.186784563f};
+
+ assert(ssuma(table1, 3) == 9.0f);
+#ifdef LOCAL_DEBUG
+ printf("%e\n",ssuma(table2, 5));
+ printf("%e\n", 9.186784f + 9.186784f + 9.186784f + 9.186784f + 9.186784f);
+ printf("%e\n", (ssuma(table2, 5) - (9.186784f + 9.186784f + 9.186784f + 9.186784f + 9.186784f)) / ssuma(table2, 5));
+#endif
+ assert((ssuma(table2, 5) - (9.186784f + 9.186784f + 9.186784f + 9.186784f + 9.186784f)) / ssuma(table2, 5) < 1e-6);
+ return 0;
+}
+
+static int csumsTest(void) {
+ floatComplex value1 = FloatComplex(3.0f, 3.0f);
+ floatComplex value2 = FloatComplex(1.123456789f, 1.123456789f);
+
+ assert(creals(csums(value1)) == 3.0f);
+ assert(cimags(csums(value1)) == 3.0f);
+ assert(creals(csums(value2)) == 1.123456789f);
+ assert(cimags(csums(value2)) == 1.123456789f);
+ return 0;
+}
+
+static int csumaTest(void) {
+ floatComplex value1 = FloatComplex(3.0f, 3.0f);
+ floatComplex table1[3];
+ floatComplex value2 = FloatComplex(9.186784563f,9.186784563f);
+ floatComplex table2[5];
+
+ table1[0] = value1;
+ table1[1] = value1;
+ table1[2] = value1;
+
+ table2[0] = value2;
+ table2[1] = value2;
+ table2[2] = value2;
+ table2[3] = value2;
+ table2[4] = value2;
+
+#ifdef LOCAL_DEBUG
+ printf("--------\n");
+ printf("%e\n", cimags(csuma(table1, 3)));
+ printf("%e\n", creals(csuma(table2, 5)));
+ printf("%e\n", cimags(csuma(table2, 5)));
+ printf("%e\n", creals(csuma(table2, 5)));
+ printf("%e\n", cimags(csuma(table2, 5)));
+ printf("--------\n");
+#endif
+ assert(creals(csuma(table1, 3)) == 9.0f);
+ assert(cimags(csuma(table1, 3)) == 9.0f);
+ assert(creals(csuma(table2, 5)) == 9.186784563f + 9.186784563f + 9.186784563f + 9.186784563f + 9.186784563f);
+ assert(cimags(csuma(table2, 5)) == 9.186784563f + 9.186784563f + 9.186784563f + 9.186784563f + 9.186784563f);
+
+ return 0;
+}
+
+static int testSum(void) {
+
+ printf("\n>>>> Sum Tests\n");
+ ssumsTest();
+ ssumaTest();
+ csumsTest();
+ csumaTest();
+
+ return 0;
+}
+
+int main(void) {
+ assert(testSum() == 0);
+ return 0;
+}
diff --git a/src/statisticsFunctions/sum/zsuma.c b/src/statisticsFunctions/sum/zsuma.c
new file mode 100644
index 00000000..e566c95a
--- /dev/null
+++ b/src/statisticsFunctions/sum/zsuma.c
@@ -0,0 +1,24 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "sum.h"
+
+doubleComplex zsuma(doubleComplex *in, int size) {
+ doubleComplex accumulate = DoubleComplex(0.0f, 0.0f);
+ int i = 0;
+
+ for (i = 0; i < size; ++i)
+ {
+ accumulate = zadds(accumulate, in[i]);
+ }
+ return accumulate;
+}