diff options
author | torset | 2008-12-02 14:29:12 +0000 |
---|---|---|
committer | torset | 2008-12-02 14:29:12 +0000 |
commit | e5782f79b99e997732f92838a121228f695c9287 (patch) | |
tree | 91c1ddaafb0acfd2176265e3947abca811a9d82c /src/signalProcessing/levin | |
parent | 16b90c523439fc108213f91dae23a248ccec9d54 (diff) | |
download | scilab2c-e5782f79b99e997732f92838a121228f695c9287.tar.gz scilab2c-e5782f79b99e997732f92838a121228f695c9287.tar.bz2 scilab2c-e5782f79b99e997732f92838a121228f695c9287.zip |
Add Levin function
Diffstat (limited to 'src/signalProcessing/levin')
-rw-r--r-- | src/signalProcessing/levin/Makefile.am | 76 | ||||
-rw-r--r-- | src/signalProcessing/levin/Makefile.in | 681 | ||||
-rw-r--r-- | src/signalProcessing/levin/dlevina.c | 193 | ||||
-rw-r--r-- | src/signalProcessing/levin/levinUtils.c | 259 | ||||
-rw-r--r-- | src/signalProcessing/levin/slevina.c | 193 | ||||
-rw-r--r-- | src/signalProcessing/levin/testDoubleLevin.c | 117 | ||||
-rw-r--r-- | src/signalProcessing/levin/testFloatLevin.c | 117 |
7 files changed, 1636 insertions, 0 deletions
diff --git a/src/signalProcessing/levin/Makefile.am b/src/signalProcessing/levin/Makefile.am new file mode 100644 index 00000000..d7a53870 --- /dev/null +++ b/src/signalProcessing/levin/Makefile.am @@ -0,0 +1,76 @@ +## +## Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +## Copyright (C) 2008 - INRIA - Arnaud TORSET +## +## 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 +## +## + + + + +libLevin_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes \ + -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/signalProcessing/includes + + +instdir = $(top_builddir)/lib + + +pkglib_LTLIBRARIES = libLevin.la + +HEAD = ../includes/levin.h + + +libLevin_la_SOURCES = $(HEAD) \ + levinUtils.c \ + slevina.c \ + dlevina.c + + +############### +#### Check #### +############### +check_PROGRAMS = testDoubleLevin testFloatLevin + + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/matrixOperations/inversion/libMatrixInversion.la \ + $(top_builddir)/matrixOperations/multiplication/libMatrixMultiplication.la \ + $(top_builddir)/matrixOperations/subtraction/libMatrixSubtraction.la \ + $(top_builddir)/matrixOperations/jmat/libJmat.la \ + $(top_builddir)/matrixOperations/eye/libMatrixEye.la \ + $(top_builddir)/signalProcessing/levin/libLevin.la \ + $(top_builddir)/operations/addition/libAddition.la \ + $(top_builddir)/operations/multiplication/libMultiplication.la \ + $(top_builddir)/operations/subtraction/libSubtraction.la \ + @LIBMATH@ + + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes \ + -I $(top_builddir)/signalProcessing/includes + + +testDoubleLevin_SOURCES = testDoubleLevin.c +testDoubleLevin_LDADD = $(check_LDADD) +testDoubleLevin_CFLAGS = $(check_INCLUDES) + +testFloatLevin_SOURCES = testFloatLevin.c +testFloatLevin_LDADD = $(check_LDADD) +testFloatLevin_CFLAGS = $(check_INCLUDES) + + +TESTS = testDoubleLevin testFloatLevin diff --git a/src/signalProcessing/levin/Makefile.in b/src/signalProcessing/levin/Makefile.in new file mode 100644 index 00000000..0fb71c9b --- /dev/null +++ b/src/signalProcessing/levin/Makefile.in @@ -0,0 +1,681 @@ +# 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 = testDoubleLevin$(EXEEXT) testFloatLevin$(EXEEXT) +TESTS = testDoubleLevin$(EXEEXT) testFloatLevin$(EXEEXT) +subdir = signalProcessing/levin +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) +libLevin_la_LIBADD = +am__objects_1 = +am_libLevin_la_OBJECTS = $(am__objects_1) libLevin_la-levinUtils.lo \ + libLevin_la-slevina.lo libLevin_la-dlevina.lo +libLevin_la_OBJECTS = $(am_libLevin_la_OBJECTS) +libLevin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libLevin_la_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_testDoubleLevin_OBJECTS = \ + testDoubleLevin-testDoubleLevin.$(OBJEXT) +testDoubleLevin_OBJECTS = $(am_testDoubleLevin_OBJECTS) +am__DEPENDENCIES_1 = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/matrixOperations/inversion/libMatrixInversion.la \ + $(top_builddir)/matrixOperations/multiplication/libMatrixMultiplication.la \ + $(top_builddir)/matrixOperations/subtraction/libMatrixSubtraction.la \ + $(top_builddir)/matrixOperations/jmat/libJmat.la \ + $(top_builddir)/matrixOperations/eye/libMatrixEye.la \ + $(top_builddir)/signalProcessing/levin/libLevin.la \ + $(top_builddir)/operations/addition/libAddition.la \ + $(top_builddir)/operations/multiplication/libMultiplication.la \ + $(top_builddir)/operations/subtraction/libSubtraction.la +testDoubleLevin_DEPENDENCIES = $(am__DEPENDENCIES_1) +testDoubleLevin_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testDoubleLevin_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_testFloatLevin_OBJECTS = testFloatLevin-testFloatLevin.$(OBJEXT) +testFloatLevin_OBJECTS = $(am_testFloatLevin_OBJECTS) +testFloatLevin_DEPENDENCIES = $(am__DEPENDENCIES_1) +testFloatLevin_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testFloatLevin_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 = $(libLevin_la_SOURCES) $(testDoubleLevin_SOURCES) \ + $(testFloatLevin_SOURCES) +DIST_SOURCES = $(libLevin_la_SOURCES) $(testDoubleLevin_SOURCES) \ + $(testFloatLevin_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@ +libLevin_la_CFLAGS = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes \ + -I $(top_builddir)/elementaryFunctions/includes \ + -I $(top_builddir)/signalProcessing/includes + +instdir = $(top_builddir)/lib +pkglib_LTLIBRARIES = libLevin.la +HEAD = ../includes/levin.h +libLevin_la_SOURCES = $(HEAD) \ + levinUtils.c \ + slevina.c \ + dlevina.c + +check_LDADD = $(top_builddir)/type/libDoubleComplex.la \ + $(top_builddir)/type/libFloatComplex.la \ + $(top_builddir)/lib/blas/libsciblas.la \ + $(top_builddir)/lib/lapack/libscilapack.la \ + $(top_builddir)/matrixOperations/inversion/libMatrixInversion.la \ + $(top_builddir)/matrixOperations/multiplication/libMatrixMultiplication.la \ + $(top_builddir)/matrixOperations/subtraction/libMatrixSubtraction.la \ + $(top_builddir)/matrixOperations/jmat/libJmat.la \ + $(top_builddir)/matrixOperations/eye/libMatrixEye.la \ + $(top_builddir)/signalProcessing/levin/libLevin.la \ + $(top_builddir)/operations/addition/libAddition.la \ + $(top_builddir)/operations/multiplication/libMultiplication.la \ + $(top_builddir)/operations/subtraction/libSubtraction.la \ + @LIBMATH@ + +check_INCLUDES = -I $(top_builddir)/type \ + -I $(top_builddir)/matrixOperations/includes \ + -I $(top_builddir)/operations/includes \ + -I $(top_builddir)/auxiliaryFunctions/includes \ + -I $(top_builddir)/signalProcessing/includes + +testDoubleLevin_SOURCES = testDoubleLevin.c +testDoubleLevin_LDADD = $(check_LDADD) +testDoubleLevin_CFLAGS = $(check_INCLUDES) +testFloatLevin_SOURCES = testFloatLevin.c +testFloatLevin_LDADD = $(check_LDADD) +testFloatLevin_CFLAGS = $(check_INCLUDES) +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 signalProcessing/levin/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign signalProcessing/levin/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 +libLevin.la: $(libLevin_la_OBJECTS) $(libLevin_la_DEPENDENCIES) + $(libLevin_la_LINK) -rpath $(pkglibdir) $(libLevin_la_OBJECTS) $(libLevin_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 +testDoubleLevin$(EXEEXT): $(testDoubleLevin_OBJECTS) $(testDoubleLevin_DEPENDENCIES) + @rm -f testDoubleLevin$(EXEEXT) + $(testDoubleLevin_LINK) $(testDoubleLevin_OBJECTS) $(testDoubleLevin_LDADD) $(LIBS) +testFloatLevin$(EXEEXT): $(testFloatLevin_OBJECTS) $(testFloatLevin_DEPENDENCIES) + @rm -f testFloatLevin$(EXEEXT) + $(testFloatLevin_LINK) $(testFloatLevin_OBJECTS) $(testFloatLevin_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLevin_la-dlevina.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLevin_la-levinUtils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libLevin_la-slevina.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testDoubleLevin-testDoubleLevin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testFloatLevin-testFloatLevin.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 $@ $< + +libLevin_la-levinUtils.lo: levinUtils.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLevin_la_CFLAGS) $(CFLAGS) -MT libLevin_la-levinUtils.lo -MD -MP -MF $(DEPDIR)/libLevin_la-levinUtils.Tpo -c -o libLevin_la-levinUtils.lo `test -f 'levinUtils.c' || echo '$(srcdir)/'`levinUtils.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLevin_la-levinUtils.Tpo $(DEPDIR)/libLevin_la-levinUtils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='levinUtils.c' object='libLevin_la-levinUtils.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) $(libLevin_la_CFLAGS) $(CFLAGS) -c -o libLevin_la-levinUtils.lo `test -f 'levinUtils.c' || echo '$(srcdir)/'`levinUtils.c + +libLevin_la-slevina.lo: slevina.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLevin_la_CFLAGS) $(CFLAGS) -MT libLevin_la-slevina.lo -MD -MP -MF $(DEPDIR)/libLevin_la-slevina.Tpo -c -o libLevin_la-slevina.lo `test -f 'slevina.c' || echo '$(srcdir)/'`slevina.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLevin_la-slevina.Tpo $(DEPDIR)/libLevin_la-slevina.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slevina.c' object='libLevin_la-slevina.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) $(libLevin_la_CFLAGS) $(CFLAGS) -c -o libLevin_la-slevina.lo `test -f 'slevina.c' || echo '$(srcdir)/'`slevina.c + +libLevin_la-dlevina.lo: dlevina.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libLevin_la_CFLAGS) $(CFLAGS) -MT libLevin_la-dlevina.lo -MD -MP -MF $(DEPDIR)/libLevin_la-dlevina.Tpo -c -o libLevin_la-dlevina.lo `test -f 'dlevina.c' || echo '$(srcdir)/'`dlevina.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libLevin_la-dlevina.Tpo $(DEPDIR)/libLevin_la-dlevina.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dlevina.c' object='libLevin_la-dlevina.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) $(libLevin_la_CFLAGS) $(CFLAGS) -c -o libLevin_la-dlevina.lo `test -f 'dlevina.c' || echo '$(srcdir)/'`dlevina.c + +testDoubleLevin-testDoubleLevin.o: testDoubleLevin.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLevin_CFLAGS) $(CFLAGS) -MT testDoubleLevin-testDoubleLevin.o -MD -MP -MF $(DEPDIR)/testDoubleLevin-testDoubleLevin.Tpo -c -o testDoubleLevin-testDoubleLevin.o `test -f 'testDoubleLevin.c' || echo '$(srcdir)/'`testDoubleLevin.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleLevin-testDoubleLevin.Tpo $(DEPDIR)/testDoubleLevin-testDoubleLevin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleLevin.c' object='testDoubleLevin-testDoubleLevin.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) $(testDoubleLevin_CFLAGS) $(CFLAGS) -c -o testDoubleLevin-testDoubleLevin.o `test -f 'testDoubleLevin.c' || echo '$(srcdir)/'`testDoubleLevin.c + +testDoubleLevin-testDoubleLevin.obj: testDoubleLevin.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testDoubleLevin_CFLAGS) $(CFLAGS) -MT testDoubleLevin-testDoubleLevin.obj -MD -MP -MF $(DEPDIR)/testDoubleLevin-testDoubleLevin.Tpo -c -o testDoubleLevin-testDoubleLevin.obj `if test -f 'testDoubleLevin.c'; then $(CYGPATH_W) 'testDoubleLevin.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleLevin.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testDoubleLevin-testDoubleLevin.Tpo $(DEPDIR)/testDoubleLevin-testDoubleLevin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testDoubleLevin.c' object='testDoubleLevin-testDoubleLevin.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) $(testDoubleLevin_CFLAGS) $(CFLAGS) -c -o testDoubleLevin-testDoubleLevin.obj `if test -f 'testDoubleLevin.c'; then $(CYGPATH_W) 'testDoubleLevin.c'; else $(CYGPATH_W) '$(srcdir)/testDoubleLevin.c'; fi` + +testFloatLevin-testFloatLevin.o: testFloatLevin.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatLevin_CFLAGS) $(CFLAGS) -MT testFloatLevin-testFloatLevin.o -MD -MP -MF $(DEPDIR)/testFloatLevin-testFloatLevin.Tpo -c -o testFloatLevin-testFloatLevin.o `test -f 'testFloatLevin.c' || echo '$(srcdir)/'`testFloatLevin.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatLevin-testFloatLevin.Tpo $(DEPDIR)/testFloatLevin-testFloatLevin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatLevin.c' object='testFloatLevin-testFloatLevin.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) $(testFloatLevin_CFLAGS) $(CFLAGS) -c -o testFloatLevin-testFloatLevin.o `test -f 'testFloatLevin.c' || echo '$(srcdir)/'`testFloatLevin.c + +testFloatLevin-testFloatLevin.obj: testFloatLevin.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testFloatLevin_CFLAGS) $(CFLAGS) -MT testFloatLevin-testFloatLevin.obj -MD -MP -MF $(DEPDIR)/testFloatLevin-testFloatLevin.Tpo -c -o testFloatLevin-testFloatLevin.obj `if test -f 'testFloatLevin.c'; then $(CYGPATH_W) 'testFloatLevin.c'; else $(CYGPATH_W) '$(srcdir)/testFloatLevin.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/testFloatLevin-testFloatLevin.Tpo $(DEPDIR)/testFloatLevin-testFloatLevin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testFloatLevin.c' object='testFloatLevin-testFloatLevin.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) $(testFloatLevin_CFLAGS) $(CFLAGS) -c -o testFloatLevin-testFloatLevin.obj `if test -f 'testFloatLevin.c'; then $(CYGPATH_W) 'testFloatLevin.c'; else $(CYGPATH_W) '$(srcdir)/testFloatLevin.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/signalProcessing/levin/dlevina.c b/src/signalProcessing/levin/dlevina.c new file mode 100644 index 00000000..f3daed9f --- /dev/null +++ b/src/signalProcessing/levin/dlevina.c @@ -0,0 +1,193 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 "levin.h" +#include "matrixInversion.h" +#include "matrixMultiplication.h" +#include <malloc.h> +#include <stdio.h> + +void dlevina (int n, double* cov, int lCov, int cCov, double* la, double* sig, double* lb){ +/* + [la and lb] + In Scilab, the return value la is a list of n elements. Each element is a matrix cCov*cCov, + and each element of the matrix is a polynome whose degree is n, so the polynome got n+1 elements. + The greatest size of a element of the list is : (n+1)*cCov*cCov. + + Here, la is a matrix which contain all elements of the list, its size is n*(n+1)*cCov*cCov. We take the + maximum size for all elements. + The first element of the list is the first (n+1)*cCov*cCov elements of la, namely la[0] to la[(n+1)*cCov*cCov-1]. + The second element of the list is the elements of la between (n+1)*cCov*cCov and 2*(n+1)*cCov*cCov,namely la[(n+1)*cCov*cCov] + to la[2*(n+1)*cCov*cCov-1],... + + Enter now in a element of the list. Take the first for example. + This is, like said before, a cCov*cCov matrix. In la, it contains (n+1)*cCov*cCov. Each element of the matrix contains (n+1) + elements. As it's stocked by columns, if we represent a matrix like [a c], for example, the elements 0 to n of la represent + [b d] + a, the elements (n+1) to 2(n+1)-1 represent b,... + + To finish, look at the elements of the matrix, the polynomes. The coefficients of the polynomes are stocked in increasing order. + + For example, if la in Scilab is : list( [3+2x 5-2x ],[3+x-x^2 -1+2x ]) + ( [-5+x -2+4x],[1+6x+3x^2 -2x-x^2 ]), the result in dlevin will be : + -la is a table of 2*3*2*2 elements(n=2,cCov=2); + -la[]={3,2,0, -5,1,0, 5,-2,0, -2,4,0, 3,1,-1, 1,6,3 -1,2,0, 0,-2,-1}. + + It's the same for lb. + + [sig] + In Scilab, the return value sig is a list of n elements. Each element is a matrix cCov*cCov, + and each element of the matrix is a scalar, so 1 element. + The greatest size of a element of the list is : cCov*cCov. + + Let see an example so know how it's stocked. + In Scilab, if sig is : list( [1 3],[5 7]) + ( [2 4],[6 8]),the result in dlevin will be : + -sig={1,2, 5,6, 3,4, 7,8}. + It's as if we put the matrix the ones under the others and we take the first column, the second,... + + + + +*/ + int i=0; +/*version ISO C99 + double tmp1[n*cCov*cCov], tmp2[n*cCov*cCov]; + double sig1[cCov], gam[cCov]; + double R1[n*cCov],R2[n*cCov],R3[n*cCov],R4[n*cCov]; +*/ +/*version pas ISO C99 */ + double *tmp1, *tmp2; + double *sig1, *gam; + double *R1,*R2,*R3,*R4; + + + + tmp1=malloc((unsigned int)((n+1)*cCov*cCov)*sizeof(double)); + tmp2=malloc((unsigned int)((n+1)*cCov*cCov)*sizeof(double)); + sig1=malloc((unsigned int)(cCov*cCov)*sizeof(double)); + gam=malloc((unsigned int)(cCov*cCov)*sizeof(double)); + R1=malloc((unsigned int)(n*cCov*cCov)*sizeof(double)); + R2=malloc((unsigned int)(n*cCov*cCov)*sizeof(double)); + R3=malloc((unsigned int)(n*cCov*cCov)*sizeof(double)); + R4=malloc((unsigned int)(n*cCov*cCov)*sizeof(double)); + + + + /* + * Initializations + * */ + dinitTab(sig,n*cCov*cCov); + dinitTab(la,n*(n+1)*cCov*cCov); + dinitTab(lb,n*(n+1)*cCov*cCov); + + /*equal to eye(la) and eye(lb) + but we can't use eye cause to the indexation*/ + for (i=0;i<cCov;i++){ + la[i*((n+1)*(cCov+1))]=1; + lb[i*((n+1)*(cCov+1))]=1; + } + + dr1(cov,lCov,cCov,n,R1); + dr2(cov,lCov,cCov,n,R2); + dr3(cov,lCov,cCov,n,R3); + dr4(cov,lCov,cCov,n,R4); + +/* case i=0 */ + + + /*calculation of sig */ + dlevinmul(la,R4,n,cCov,0,sig,n*cCov,0,'d'); + /*calculation of gam1 */ + dlevinmul(lb,R2,n,cCov,0,gam,cCov,0,'u'); + /*calculation of c1*r1 */ + dlevinmul(la,R1,n,cCov,0,tmp1,cCov,0,'u'); + /*calculation of inv(gam1) */ + dinverma(gam,sig1,cCov); + dinitTab(gam,cCov*cCov); + /*calculation of k1 = c1*r1*inv(gam1) */ + dmulma(tmp1,cCov,cCov,sig1,cCov,cCov,tmp2); + dinitTab(tmp1,n*cCov*cCov); + dinitTab(sig1,cCov*cCov); + /*calculation of k1*lb */ + dlevinmul2(tmp2,lb,0,n,cCov,tmp1); + dinitTab(tmp2,n*cCov*cCov); + /*calculation of k1*lb*z */ + ddecalage(tmp1,0,n,cCov,tmp1); + /*calculation of la */ + dlevinsub(la,tmp1,n,cCov,0,0,la); + dinitTab(tmp1,n*cCov*cCov); + + /*calculation of sig1 (we extract the value if sig at time 0)*/ + dlevinsig(sig,0,cCov,n*cCov,sig1); + /*calculation of c2*r3 */ + dlevinmul(lb,R3,n,cCov,0,tmp1,cCov,0,'d'); + /*calculation of inv(sig1)*/ + dinverma(sig1,gam,cCov); + dinitTab(sig1,cCov*cCov); + /*calculation of k2 = c2*r3*inv(sig1) */ + dmulma(tmp1,cCov,cCov,gam,cCov,cCov,tmp2); + dinitTab(tmp1,n*cCov*cCov); + dinitTab(gam,cCov*cCov); + /*calculation of k2*la (here it's lb cause la have been modified + and the precedent values hadn't been saved)*/ + dlevinmul2(tmp2,lb,0,n,cCov,tmp1); + dinitTab(tmp2,n*cCov*cCov); + /*calculation of lb*z */ + ddecalage(lb,0,n,cCov,lb); + /*calculation of lb */ + dlevinsub(lb,tmp1,n,cCov,0,0,lb); + dinitTab(tmp1,n*cCov*cCov); + dinitTab(tmp2,n*cCov*cCov); + + + for (i=1;i<n;i++){ + dlevinmul(la,R4,n,cCov,i,sig,n*cCov,1,'d'); + dlevinmul(lb,R2,n,cCov,i,gam,cCov,0,'u'); + dlevinmul(la,R1,n,cCov,i,tmp1,cCov,0,'u'); + dinverma(gam,sig1,cCov); + dinitTab(gam,cCov*cCov); + dmulma(tmp1,cCov,cCov,sig1,cCov,cCov,tmp2); + + dinitTab(tmp1,n*cCov*cCov); + dlevinmul2(tmp2,lb,i-1,n,cCov,tmp1); + dinitTab(tmp2,n*cCov*cCov); + ddecalage(tmp1,0,n,cCov,tmp1); + dlevinsub(la,tmp1,n,cCov,i,i,la);/*a*/ + dinitTab(tmp1,n*cCov*cCov); + + /*calculation of sig1 (we extract the value if sig at time i)*/ + dlevinsig(sig,i,cCov,n*cCov,sig1); + dlevinmul(lb,R3,n,cCov,i,tmp1,cCov,0,'d'); + dinverma(sig1,gam,cCov); + dinitTab(sig1,cCov*cCov); + dmulma(tmp1,cCov,cCov,gam,cCov,cCov,tmp2); + dinitTab(tmp1,n*cCov*cCov); + /*calculation of k2*la (now it's la at time (i-1))*/ + dlevinmul2(tmp2,la,i-1,n,cCov,tmp1); + dinitTab(tmp2,n*cCov*cCov); + ddecalage(lb,(i-1)*(n+1)*cCov*cCov,n,cCov,tmp2); + dlevinsub(tmp2,tmp1,n,cCov,0,i,lb); + dinitTab(tmp1,n*cCov*cCov); + dinitTab(tmp2,n*cCov*cCov); + } + + + free(R4); + free(R3); + free(R2); + free(R1); + free(gam); + free(sig1); + free(tmp2); + free(tmp1); +} diff --git a/src/signalProcessing/levin/levinUtils.c b/src/signalProcessing/levin/levinUtils.c new file mode 100644 index 00000000..b7eb2b4a --- /dev/null +++ b/src/signalProcessing/levin/levinUtils.c @@ -0,0 +1,259 @@ +#include "levin.h" + +/* Double Functions */ +void dr1(double *in,int lines, int rows, int n, double * out){ + int i,j; + for (i=0;i<n*rows;i++) { + for (j=0;j<rows;j++){ + out[i+j*n*rows]=in[(n-i/rows)*rows + i%rows + j*lines]; + } + } +} + +void dr2(double *in,int lines, int rows, int n, double * out){ + int i,j; + for (i=0;i<n*rows;i++) { + for (j=0;j<rows;j++){ + out[i+j*n*rows]=in[(n-1-i/rows)*rows + i%rows + j*lines]; + } + } +} + + +void dr3(double *in,int lines, int rows, int n, double * out){ + int i,j; + for (i=0;i<n*rows;i++) { + for (j=0;j<rows;j++){ + out[i+j*n*rows]=in[(i/rows+1)*rows + j%rows + (i%rows)*lines]; + } + } +} + + +void dr4(double *in,int lines, int rows, int n, double * out){ + int i,j; + for (i=0;i<n*rows;i++) { + for (j=0;j<rows;j++){ + out[i+j*n*rows]=in[i + j%rows + (i%rows)*(lines-1)]; + } + } +} + + + +void dlevinmul(double* in1, double* in2, int n, int rows, int ind_boucle, double* out, int lines, int deb_out,char choix){ + int i=0, j=0, debut=0,start_out=0; + double accu; + + if (ind_boucle==0) debut=0; + else debut = (ind_boucle-1)*(n+1)*rows*rows; + + start_out = deb_out*ind_boucle*rows; + + switch(choix){ + case 'u' : + for (i=0;i<rows*rows;i++){ + accu=0; + for(j=0;j<ind_boucle*rows+rows;j++){ + accu += in1[debut+i%rows*(n+1) + (rows*(n+1))*(j%rows)+j/rows] * in2[n*rows-((ind_boucle+1)*rows)+j+(i/rows)*n*rows]; + } + out[start_out+i%rows+(i/rows)*lines] = accu; + } + break; + case 'd' : + for (i=0;i<rows*rows;i++){ + accu=0; + for(j=0;j<ind_boucle*rows+rows;j++){ + accu+=in1[debut+i%rows*(n+1) + (rows*(n+1))*(j%rows)+j/rows]*in2[j+(i/rows)*n*rows]; + } + out[start_out+i%rows+(i/rows)*lines] = accu; + } + break; + default : break; + } +} + + + +void dlevinsig(double *sig,int n, int rows, int lines, double *sig1){ + int i=0; + for (i=0;i<rows*rows;i++){ + sig1[i]=sig[n*rows + i%rows +(i/rows)*lines]; + } +} + + +void dlevinmul2(double* in1, double *in2,int ind_boucle,int n,int rows,double* out){ + int i=0,j=0, debut; + double accu; + debut = ind_boucle*(n+1)*rows*rows; + for(i=0;i<(n+1)*rows*rows;i++){ + accu=0; + for (j=0;j<rows;j++){ + accu += in1[(i/(n+1))%rows+j*rows]*in2[debut+i%(n+1)+(i/((n+1)*rows))*(n+1)*rows+j*(n+1)]; + } + out[i]=accu; + } +} + + +void dlevinsub(double* in1, double* in2, int n, int rows, int deb_in, int ind_boucle, double* out){ + int i=0; + int deb_out= ind_boucle*(n+1)*rows*rows; + int deb_in1; + + if (deb_in==0) deb_in1=0; + else deb_in1=(deb_in-1)*(n+1)*rows*rows; + + for (i=0;i<(n+1)*rows*rows;i++){ + out[deb_out + i] = in1[deb_in1+i]-in2[i]; + } +} + +void dinitTab(double* in, int size){ + int i; + for (i=0;i<size;i++) in[i]=0; +} + + +void ddecalage(double* in, int deb_in,int n,int rows,double *out){ + int i=0,j=0; + + for (i=0;i<rows*rows;i++){ + for(j=n;j>0;j--) {out[i*(n+1)+j]=in[i*(n+1)+deb_in+j-1];} + out[i*(n+1)]=0; + } + +} + + + + + +/* Float Functions */ + +void sr1(float *in,int lines, int rows, int n, float * out){ + int i,j; + for (i=0;i<n*rows;i++) { + for (j=0;j<rows;j++){ + out[i+j*n*rows]=in[(n-i/rows)*rows + i%rows + j*lines]; + } + } +} + +void sr2(float *in,int lines, int rows, int n, float * out){ + int i,j; + for (i=0;i<n*rows;i++) { + for (j=0;j<rows;j++){ + out[i+j*n*rows]=in[(n-1-i/rows)*rows + i%rows + j*lines]; + } + } +} + + +void sr3(float *in,int lines, int rows, int n, float * out){ + int i,j; + for (i=0;i<n*rows;i++) { + for (j=0;j<rows;j++){ + out[i+j*n*rows]=in[(i/rows+1)*rows + j%rows + (i%rows)*lines]; + } + } +} + + +void sr4(float *in,int lines, int rows, int n, float * out){ + int i,j; + for (i=0;i<n*rows;i++) { + for (j=0;j<rows;j++){ + out[i+j*n*rows]=in[i + j%rows + (i%rows)*(lines-1)]; + } + } +} + + + +void slevinmul(float* in1, float* in2, int n, int rows, int ind_boucle, float* out, int lines, int deb_out,char choix){ + int i=0, j=0, debut=0,start_out=0; + float accu; + + if (ind_boucle==0) debut=0; + else debut = (ind_boucle-1)*(n+1)*rows*rows; + + start_out = deb_out*ind_boucle*rows; + + switch(choix){ + case 'u' : + for (i=0;i<rows*rows;i++){ + accu=0; + for(j=0;j<ind_boucle*rows+rows;j++){ + accu += in1[debut+i%rows*(n+1) + (rows*(n+1))*(j%rows)+j/rows] * in2[n*rows-((ind_boucle+1)*rows)+j+(i/rows)*n*rows]; + } + out[start_out+i%rows+(i/rows)*lines] = accu; + } + break; + case 'd' : + for (i=0;i<rows*rows;i++){ + accu=0; + for(j=0;j<ind_boucle*rows+rows;j++){ + accu+=in1[debut+i%rows*(n+1) + (rows*(n+1))*(j%rows)+j/rows]*in2[j+(i/rows)*n*rows]; + } + out[start_out+i%rows+(i/rows)*lines] = accu; + } + break; + default : break; + } +} + + + +void slevinsig(float *sig,int n, int rows, int lines, float *sig1){ + int i=0; + for (i=0;i<rows*rows;i++){ + sig1[i]=sig[n*rows + i%rows +(i/rows)*lines]; + } +} + + +void slevinmul2(float* in1, float *in2,int ind_boucle,int n,int rows,float* out){ + int i=0,j=0, debut; + float accu; + debut = ind_boucle*(n+1)*rows*rows; + for(i=0;i<(n+1)*rows*rows;i++){ + accu=0; + for (j=0;j<rows;j++){ + accu += in1[(i/(n+1))%rows+j*rows]*in2[debut+i%(n+1)+(i/((n+1)*rows))*(n+1)*rows+j*(n+1)]; + } + out[i]=accu; + } +} + + +void slevinsub(float* in1, float* in2, int n, int rows, int deb_in, int ind_boucle, float* out){ + int i=0; + int deb_out= ind_boucle*(n+1)*rows*rows; + int deb_in1; + + if (deb_in==0) deb_in1=0; + else deb_in1=(deb_in-1)*(n+1)*rows*rows; + + for (i=0;i<(n+1)*rows*rows;i++){ + out[deb_out + i] = in1[deb_in1+i]-in2[i]; + } +} + +void sinitTab(float* in, int size){ + int i; + for (i=0;i<size;i++) in[i]=0; +} + + +void sdecalage(float* in, int deb_in,int n,int rows,float *out){ + int i=0,j=0; + + for (i=0;i<rows*rows;i++){ + for(j=n;j>0;j--) {out[i*(n+1)+j]=in[i*(n+1)+deb_in+j-1];} + out[i*(n+1)]=0; + } + +} + diff --git a/src/signalProcessing/levin/slevina.c b/src/signalProcessing/levin/slevina.c new file mode 100644 index 00000000..636aa285 --- /dev/null +++ b/src/signalProcessing/levin/slevina.c @@ -0,0 +1,193 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 "levin.h" +#include "matrixInversion.h" +#include "matrixMultiplication.h" +#include <malloc.h> +#include <stdio.h> + +void slevina (int n, float* cov, int lCov, int cCov, float* la, float* sig, float* lb){ +/* + [la and lb] + In Scilab, the return value la is a list of n elements. Each element is a matrix cCov*cCov, + and each element of the matrix is a polynome whose degree is n, so the polynome got n+1 elements. + The greatest size of a element of the list is : (n+1)*cCov*cCov. + + Here, la is a matrix which contain all elements of the list, its size is n*(n+1)*cCov*cCov. We take the + maximum size for all elements. + The first element of the list is the first (n+1)*cCov*cCov elements of la, namely la[0] to la[(n+1)*cCov*cCov-1]. + The second element of the list is the elements of la between (n+1)*cCov*cCov and 2*(n+1)*cCov*cCov,namely la[(n+1)*cCov*cCov] + to la[2*(n+1)*cCov*cCov-1],... + + Enter now in a element of the list. Take the first for example. + This is, like said before, a cCov*cCov matrix. In la, it contains (n+1)*cCov*cCov. Each element of the matrix contains (n+1) + elements. As it's stocked by columns, if we represent a matrix like [a c], for example, the elements 0 to n of la represent + [b d] + a, the elements (n+1) to 2(n+1)-1 represent b,... + + To finish, look at the elements of the matrix, the polynomes. The coefficients of the polynomes are stocked in increasing order. + + For example, if la in Scilab is : list( [3+2x 5-2x ],[3+x-x^2 -1+2x ]) + ( [-5+x -2+4x],[1+6x+3x^2 -2x-x^2 ]), the result in dlevin will be : + -la is a table of 2*3*2*2 elements(n=2,cCov=2); + -la[]={3,2,0, -5,1,0, 5,-2,0, -2,4,0, 3,1,-1, 1,6,3 -1,2,0, 0,-2,-1}. + + It's the same for lb. + + [sig] + In Scilab, the return value sig is a list of n elements. Each element is a matrix cCov*cCov, + and each element of the matrix is a scalar, so 1 element. + The greatest size of a element of the list is : cCov*cCov. + + Let see an example so know how it's stocked. + In Scilab, if sig is : list( [1 3],[5 7]) + ( [2 4],[6 8]),the result in dlevin will be : + -sig={1,2, 5,6, 3,4, 7,8}. + It's as if we put the matrix the ones under the others and we take the first column, the second,... + + + + +*/ + int i=0; +/*version ISO C99 + double tmp1[n*cCov*cCov], tmp2[n*cCov*cCov]; + double sig1[cCov], gam[cCov]; + double R1[n*cCov],R2[n*cCov],R3[n*cCov],R4[n*cCov]; +*/ +/*version pas ISO C99 */ + float *tmp1, *tmp2; + float *sig1, *gam; + float *R1,*R2,*R3,*R4; + + + + tmp1=malloc((unsigned int)((n+1)*cCov*cCov)*sizeof(float)); + tmp2=malloc((unsigned int)((n+1)*cCov*cCov)*sizeof(float)); + sig1=malloc((unsigned int)(cCov*cCov)*sizeof(float)); + gam=malloc((unsigned int)(cCov*cCov)*sizeof(float)); + R1=malloc((unsigned int)(n*cCov*cCov)*sizeof(float)); + R2=malloc((unsigned int)(n*cCov*cCov)*sizeof(float)); + R3=malloc((unsigned int)(n*cCov*cCov)*sizeof(float)); + R4=malloc((unsigned int)(n*cCov*cCov)*sizeof(float)); + + + + /* + * Initializations + * */ + sinitTab(sig,n*cCov*cCov); + sinitTab(la,n*(n+1)*cCov*cCov); + sinitTab(lb,n*(n+1)*cCov*cCov); + + /*equal to eye(la) and eye(lb) + but we can't use eye cause to the indexation*/ + for (i=0;i<cCov;i++){ + la[i*((n+1)*(cCov+1))]=1; + lb[i*((n+1)*(cCov+1))]=1; + } + + sr1(cov,lCov,cCov,n,R1); + sr2(cov,lCov,cCov,n,R2); + sr3(cov,lCov,cCov,n,R3); + sr4(cov,lCov,cCov,n,R4); + +/* case i=0 */ + + + /*calculation of sig */ + slevinmul(la,R4,n,cCov,0,sig,n*cCov,0,'d'); + /*calculation of gam1 */ + slevinmul(lb,R2,n,cCov,0,gam,cCov,0,'u'); + /*calculation of c1*r1 */ + slevinmul(la,R1,n,cCov,0,tmp1,cCov,0,'u'); + /*calculation of inv(gam1) */ + sinverma(gam,sig1,cCov); + sinitTab(gam,cCov*cCov); + /*calculation of k1 = c1*r1*inv(gam1) */ + smulma(tmp1,cCov,cCov,sig1,cCov,cCov,tmp2); + sinitTab(tmp1,n*cCov*cCov); + sinitTab(sig1,cCov*cCov); + /*calculation of k1*lb */ + slevinmul2(tmp2,lb,0,n,cCov,tmp1); + sinitTab(tmp2,n*cCov*cCov); + /*calculation of k1*lb*z */ + sdecalage(tmp1,0,n,cCov,tmp1); + /*calculation of la */ + slevinsub(la,tmp1,n,cCov,0,0,la); + sinitTab(tmp1,n*cCov*cCov); + + /*calculation of sig1 (we extract the value if sig at time 0)*/ + slevinsig(sig,0,cCov,n*cCov,sig1); + /*calculation of c2*r3 */ + slevinmul(lb,R3,n,cCov,0,tmp1,cCov,0,'d'); + /*calculation of inv(sig1)*/ + sinverma(sig1,gam,cCov); + sinitTab(sig1,cCov*cCov); + /*calculation of k2 = c2*r3*inv(sig1) */ + smulma(tmp1,cCov,cCov,gam,cCov,cCov,tmp2); + sinitTab(tmp1,n*cCov*cCov); + sinitTab(gam,cCov*cCov); + /*calculation of k2*la (here it's lb cause la have been modified + and the precedent values hadn't been saved)*/ + slevinmul2(tmp2,lb,0,n,cCov,tmp1); + sinitTab(tmp2,n*cCov*cCov); + /*calculation of lb*z */ + sdecalage(lb,0,n,cCov,lb); + /*calculation of lb */ + slevinsub(lb,tmp1,n,cCov,0,0,lb); + sinitTab(tmp1,n*cCov*cCov); + sinitTab(tmp2,n*cCov*cCov); + + + for (i=1;i<n;i++){ + slevinmul(la,R4,n,cCov,i,sig,n*cCov,1,'d'); + slevinmul(lb,R2,n,cCov,i,gam,cCov,0,'u'); + slevinmul(la,R1,n,cCov,i,tmp1,cCov,0,'u'); + sinverma(gam,sig1,cCov); + sinitTab(gam,cCov*cCov); + smulma(tmp1,cCov,cCov,sig1,cCov,cCov,tmp2); + + sinitTab(tmp1,n*cCov*cCov); + slevinmul2(tmp2,lb,i-1,n,cCov,tmp1); + sinitTab(tmp2,n*cCov*cCov); + sdecalage(tmp1,0,n,cCov,tmp1); + slevinsub(la,tmp1,n,cCov,i,i,la);/*a*/ + sinitTab(tmp1,n*cCov*cCov); + + /*calculation of sig1 (we extract the value if sig at time i)*/ + slevinsig(sig,i,cCov,n*cCov,sig1); + slevinmul(lb,R3,n,cCov,i,tmp1,cCov,0,'d'); + sinverma(sig1,gam,cCov); + sinitTab(sig1,cCov*cCov); + smulma(tmp1,cCov,cCov,gam,cCov,cCov,tmp2); + sinitTab(tmp1,n*cCov*cCov); + /*calculation of k2*la (now it's la at time (i-1))*/ + slevinmul2(tmp2,la,i-1,n,cCov,tmp1); + sinitTab(tmp2,n*cCov*cCov); + sdecalage(lb,(i-1)*(n+1)*cCov*cCov,n,cCov,tmp2); + slevinsub(tmp2,tmp1,n,cCov,0,i,lb); + sinitTab(tmp1,n*cCov*cCov); + sinitTab(tmp2,n*cCov*cCov); + } + + + free(R4); + free(R3); + free(R2); + free(R1); + free(gam); + free(sig1); + free(tmp2); + free(tmp1); +} diff --git a/src/signalProcessing/levin/testDoubleLevin.c b/src/signalProcessing/levin/testDoubleLevin.c new file mode 100644 index 00000000..20560da4 --- /dev/null +++ b/src/signalProcessing/levin/testDoubleLevin.c @@ -0,0 +1,117 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 <stdio.h> +#include <assert.h> +#include "levin.h" + + + +static void dlevinaTest(void) { + int n=15; + +/* int i=0; + + double cov[128]={2.1632471,0.6253206,-0.2212568,-0.6154865,-0.2646837,0.0144518,-0.2511410,-0.5401314, \ +-0.3017069,0.6439519,1.0938702,0.5916342,-0.2832519,-0.5799388,-0.2711958,0.0740953,\ +-0.2646536,-0.6427527,-0.2888743,0.5798061,1.0301717,0.5939465,-0.1991420,-0.6068337,\ +-0.2532973,-0.0156329,-0.2872505,-0.5836588,-0.2913317,0.5783603,1.0635956,0.5822280,\ +-0.2711408,-0.6209564,-0.2485693,-0.0334097,-0.2733096,-0.5363602,-0.2689253,0.5987651,\ +1.0441869,0.5835384,-0.2934934,-0.5838854,-0.2848314,-0.0111112,-0.2838466,-0.5757844, \ +-0.2925714,0.5468999,1.0859833,0.6045700,-0.2491218,-0.6152090,-0.2322848,-0.0206893, \ +-0.3015463,-0.5653637,-0.2812883,0.5947973,1.0040374,0.5830293,-0.2684794,-0.5986135, \ +-0.2673449,-0.0504689,-0.2989750,-0.5510215,-0.2771791,0.5943756,0.9436008,0.5795994, \ +-0.2586094,-0.5544826,-0.2474743,0.0262180,-0.2474046,-0.5373957,-0.2932611,0.5803651,\ +0.9859401,0.5729370,-0.2169815,-0.5399512,-0.2332551,-0.0151484,-0.274592,-0.5905861, \ +-0.2844705,0.5987613,0.9710525,0.5330744,-0.2443102,-0.5858032,-0.2166843,-0.0028519, \ +-0.2613759,-0.5451755,-0.2489879,0.4847080,0.9502086,0.5870537,-0.2648506,-0.5585377, \ +-0.2867994,0.0067153,-0.2101314,-0.5189354,-0.2473348,0.5727840,0.9393745,0.5947526, \ +-0.2382349,-0.5675628,-0.2202667,-0.0863862,-0.2534431,-0.5561705,-0.2503315,0.5649435, \ +0.9288405,0.5373113,-0.2468931,-0.5345938,-0.2767231,-0.0397433,-0.2345866,-0.4977333};*/ + + double cov2[256]={1.8542341,0.2302480,0.5424259,0.2396233,-0.2802882,-0.1343754,-0.4585444,-0.0852306,\ + -0.3683334,0.0258069,-0.0655487,0.1546545,-0.3655665,-0.0310238,-0.4565569,0.0441730,\ + -0.1386023,-0.0434076,0.5189599,0.0357233,1.0210283,0.1781705,0.5183526,0.0801215,\ + -0.1862581,-0.1739927,-0.4755297,-0.1160617,-0.2512805,0.1471775,-0.0995046,0.1707012,\ + -0.3269761,-0.0112160,-0.4411032,-0.0872514,-0.1757269,-0.1472844,0.5471859,-0.0644483,\ + 0.8977092,0.2136813,0.3942809,-0.0382849,-0.1260751,-0.0965459,-0.5126250,-0.1452914,\ + -0.3046589,-0.0022501,0.0350519,0.2645226,-0.2509645,-0.0365893,-0.5183898,-0.0318046,\ + -0.1743803,-0.0873962,0.5372009,-0.1704277,0.7164172,0.1710189,0.4685590,-0.0759859,\ + -0.1911539,-0.0679539,-0.4706253,-0.0519689,-0.2791620,-0.0583353,-0.0267250,0.1014851,\ + -0.1576785,-0.1655821,-0.3847449,-0.0386553,-0.1297910,0.0083667,0.4836641,-0.0939749,\ + 0.7437560,0.2901242,0.3853338,0.0798201,-0.1689064,-0.1747635,-0.5110532,-0.1476417,\ + -0.1808702,0.0963522,0.0174652,0.2306552,-0.2592396,-0.1491170,-0.3227275,0.0629281,\ + -0.1185767,-0.0827683,0.4598633,0.0349602,0.6505747,0.3114497,0.2631378,-0.0103355,\ + -0.3194549,-0.2351815,-0.4274886,-0.1750659,-0.0813017,0.1245920,-0.0664094,0.1473835,\ + -0.2078978,-0.1688748,-0.3425365,0.1354790,-0.1685176,-0.1444135,0.3966746,-0.177444,\ + 0.5809542,0.2654948,0.3486682,0.0369250,-0.1920808,-0.1351589,-0.4381282,-0.1431602,\ +0.2302480,2.020749,-0.1453147,-0.4816412,-0.1059289,-0.3953205,0.0167060,0.5071499,\ + -0.0438978,-0.2461159,0.1641866,-0.0420505,-0.0166320,-0.1641097,-0.2515164,0.5068871,\ + -0.2113012,-0.3582454,0.1358039,-0.5180938,0.3298329,1.0316539,-0.1190920,-0.4336184,\ + -0.0743425,-0.1711531,0.0595813,0.5856594,0.0258974,-0.2492872,0.1667785,-0.1520977,\ + -0.0087917,-0.1656533,0.0463118,0.4459719,-0.1475134,-0.2804235,-0.2214265,-0.3674264,\ + 0.2137918,0.7380489,0.0643087,-0.4993311,0.0903295,-0.2392031,-0.0495192,0.4715900,\ + 0.0560724,-0.0850974,0.1811686,0.0572052,-0.0733149,-0.3059423,-0.1168040,0.4098819,\ + -0.1070201,-0.4125769,-0.0502986,-0.4541070,0.1923829,0.9167427,-0.0450642,-0.3861262,\ + -0.0551742,-0.2979827,-0.0868854,0.4011319,0.1660530,-0.1986059,0.2734969,-0.0263159,\ + 0.0112668,-0.0763537,-0.1452256,0.5250867,-0.1852298,-0.3335027,-0.1114010,-0.4129438,\ + 0.1639697,0.7177437,-0.1688863,-0.4391817,-0.0468476,-0.2069082,-0.0635808,0.4981539,\ + -0.0965365,-0.2057104,0.2059908,-0.2499686,-0.0270036,-0.0794378,-0.0264147,0.3461999,\ + -0.0746288,-0.3044705,-0.1251745,-0.2032644,0.0744516,0.7004425,-0.1367678,-0.5699592,\ + -0.0909027,-0.3123118,0.0731459,0.3900814,-0.0056685,-0.0145168,0.1415849,-0.0899785,\ + -0.0770252,-0.1568634,0.0146449,0.2642178,-0.0843896,-0.2369412,0.0091955,-0.2899846,\ + 0.0811130,0.6213581,-0.2800630,-0.3767941,-0.0630885,-0.155981,0.0395355,0.3978243}; + + double la[15*16*2*2],lb[15*16*2*2],sig[15*2*2]; + + dlevina(n,cov2,128,2,la,sig,lb); + +/* + for (i=0;i<15*16*2*2;i++){ + printf("indice : %d valeur : %f - ",i,la[i]); + printf("\n"); + if((i+1)%64==0)printf("------------------------------------\n"); + if((i+1)%16==0)printf("###############\n"); + } + printf("\n"); + printf("\n"); + printf("\n"); + for (i=0;i<15;i++){ + printf("i : %d - lb = ",i); + for (j=0;j<15;j++) printf(" %f - ",lb[15*i+j]); + printf("\n"); + } + printf("\n"); + printf("\n"); + printf("\n"); + + + for (i=0;i<15*2;i++){ + printf("indice : %d %f | indice : %d %f\n",i,sig[i],i+30,sig[i+30]); + } +*/ + +} + + + +static int levinTest(void) { + printf("\n>>>> Levin Tests\n"); + dlevinaTest(); + return 0; +} + +int main(void) { + assert( levinTest()== 0); + return 0; +} diff --git a/src/signalProcessing/levin/testFloatLevin.c b/src/signalProcessing/levin/testFloatLevin.c new file mode 100644 index 00000000..82c874fa --- /dev/null +++ b/src/signalProcessing/levin/testFloatLevin.c @@ -0,0 +1,117 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - INRIA - Arnaud TORSET + * + * 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 <stdio.h> +#include <assert.h> +#include "levin.h" + + + +static void slevinaTest(void) { + int n=15; + +/* int i=0; +*/ + float cov[128]={2.1632471f,0.6253206f,-0.2212568f,-0.6154865f,-0.2646837f,0.0144518f,-0.2511410f,-0.5401314f, \ +-0.3017069f,0.6439519f,1.0938702f,0.5916342f,-0.2832519f,-0.5799388f,-0.2711958f,0.0740953f,\ +-0.2646536f,-0.6427527f,-0.2888743f,0.5798061f,1.0301717f,0.5939465f,-0.1991420f,-0.6068337f,\ +-0.2532973f,-0.0156329f,-0.2872505f,-0.5836588f,-0.2913317f,0.5783603f,1.0635956f,0.5822280f,\ +-0.2711408f,-0.6209564f,-0.2485693f,-0.0334097f,-0.2733096f,-0.5363602f,-0.2689253f,0.5987651f,\ +1.0441869f,0.5835384f,-0.2934934f,-0.5838854f,-0.2848314f,-0.0111112f,-0.2838466f,-0.5757844f, \ +-0.2925714f,0.5468999f,1.0859833f,0.6045700f,-0.2491218f,-0.6152090f,-0.2322848f,-0.0206893f, \ +-0.3015463f,-0.5653637f,-0.2812883f,0.5947973f,1.0040374f,0.5830293f,-0.2684794f,-0.5986135f, \ +-0.2673449f,-0.0504689f,-0.2989750f,-0.5510215f,-0.2771791f,0.5943756f,0.9436008f,0.5795994f, \ +-0.2586094f,-0.5544826f,-0.2474743f,0.0262180f,-0.2474046f,-0.5373957f,-0.2932611f,0.5803651f,\ +0.9859401f,0.5729370f,-0.2169815f,-0.5399512f,-0.2332551f,-0.0151484f,-0.274592f,-0.5905861f, \ +-0.2844705f,0.5987613f,0.9710525f,0.5330744f,-0.2443102f,-0.5858032f,-0.2166843f,-0.0028519f, \ +-0.2613759f,-0.5451755f,-0.2489879f,0.4847080f,0.9502086f,0.5870537f,-0.2648506f,-0.5585377f, \ +-0.2867994f,0.0067153f,-0.2101314f,-0.5189354f,-0.2473348f,0.5727840f,0.9393745f,0.5947526f, \ +-0.2382349f,-0.5675628f,-0.2202667f,-0.0863862f,-0.2534431f,-0.5561705f,-0.2503315f,0.5649435f, \ +0.9288405f,0.5373113f,-0.2468931f,-0.5345938f,-0.2767231f,-0.0397433f,-0.2345866f,-0.4977333f}; + +/* float cov2[256]={1.8542341f,0.2302480f,0.5424259f,0.2396233f,-0.2802882f,-0.1343754f,-0.4585444f,-0.0852306f,\ + -0.3683334f,0.0258069f,-0.0655487f,0.1546545f,-0.3655665f,-0.0310238f,-0.4565569f,0.0441730f,\ + -0.1386023f,-0.0434076f,0.5189599f,0.0357233f,1.0210283f,0.1781705f,0.5183526f,0.0801215f,\ + -0.1862581f,-0.1739927f,-0.4755297f,-0.1160617f,-0.2512805f,0.1471775f,-0.0995046f,0.1707012f,\ + -0.3269761f,-0.0112160f,-0.4411032f,-0.0872514f,-0.1757269f,-0.1472844f,0.5471859f,-0.0644483f,\ + 0.8977092f,0.2136813f,0.3942809f,-0.0382849f,-0.1260751f,-0.0965459f,-0.5126250f,-0.1452914f,\ + -0.3046589f,-0.0022501f,0.0350519f,0.2645226f,-0.2509645f,-0.0365893f,-0.5183898f,-0.0318046f,\ + -0.1743803f,-0.0873962f,0.5372009f,-0.1704277f,0.7164172f,0.1710189f,0.4685590f,-0.0759859f,\ + -0.1911539f,-0.0679539f,-0.4706253f,-0.0519689f,-0.2791620f,-0.0583353f,-0.0267250f,0.1014851f,\ + -0.1576785f,-0.1655821f,-0.3847449f,-0.0386553f,-0.1297910f,0.0083667f,0.4836641f,-0.0939749f,\ + 0.7437560f,0.2901242f,0.3853338f,0.0798201f,-0.1689064f,-0.1747635f,-0.5110532f,-0.1476417f,\ + -0.1808702f,0.0963522f,0.0174652f,0.2306552f,-0.2592396f,-0.1491170f,-0.3227275f,0.0629281f,\ + -0.1185767f,-0.0827683f,0.4598633f,0.0349602f,0.6505747f,0.3114497f,0.2631378f,-0.0103355f,\ + -0.3194549f,-0.2351815f,-0.4274886f,-0.1750659f,-0.0813017f,0.1245920f,-0.0664094f,0.1473835f,\ + -0.2078978f,-0.1688748f,-0.3425365f,0.1354790f,-0.1685176f,-0.1444135f,0.3966746f,-0.177444f,\ + 0.5809542f,0.2654948f,0.3486682f,0.0369250f,-0.1920808f,-0.1351589f,-0.4381282f,-0.1431602f,\ +0.2302480f,2.020749f,-0.1453147f,-0.4816412f,-0.1059289f,-0.3953205f,0.0167060f,0.5071499f,\ + -0.0438978f,-0.2461159f,0.1641866f,-0.0420505f,-0.0166320f,-0.1641097f,-0.2515164f,0.5068871f,\ + -0.2113012f,-0.3582454f,0.1358039f,-0.5180938f,0.3298329f,1.0316539f,-0.1190920f,-0.4336184f,\ + -0.0743425f,-0.1711531f,0.0595813f,0.5856594f,0.0258974f,-0.2492872f,0.1667785f,-0.1520977f,\ + -0.0087917f,-0.1656533f,0.0463118f,0.4459719f,-0.1475134f,-0.2804235f,-0.2214265f,-0.3674264f,\ + 0.2137918f,0.7380489f,0.0643087f,-0.4993311f,0.0903295f,-0.2392031f,-0.0495192f,0.4715900f,\ + 0.0560724f,-0.0850974f,0.1811686f,0.0572052f,-0.0733149f,-0.3059423f,-0.1168040f,0.4098819f,\ + -0.1070201f,-0.4125769f,-0.0502986f,-0.4541070f,0.1923829f,0.9167427f,-0.0450642f,-0.3861262f,\ + -0.0551742f,-0.2979827f,-0.0868854f,0.4011319f,0.1660530f,-0.1986059f,0.2734969f,-0.0263159f,\ + 0.0112668f,-0.0763537f,-0.1452256f,0.5250867f,-0.1852298f,-0.3335027f,-0.1114010f,-0.4129438f,\ + 0.1639697f,0.7177437f,-0.1688863f,-0.4391817f,-0.0468476f,-0.2069082f,-0.0635808f,0.4981539f,\ + -0.0965365f,-0.2057104f,0.2059908f,-0.2499686f,-0.0270036f,-0.0794378f,-0.0264147f,0.3461999f,\ + -0.0746288f,-0.3044705f,-0.1251745f,-0.2032644f,0.0744516f,0.7004425f,-0.1367678f,-0.5699592f,\ + -0.0909027f,-0.3123118f,0.0731459f,0.3900814f,-0.0056685f,-0.0145168f,0.1415849f,-0.0899785f,\ + -0.0770252f,-0.1568634f,0.0146449f,0.2642178f,-0.0843896f,-0.2369412f,0.0091955f,-0.2899846f,\ + 0.0811130f,0.6213581f,-0.2800630f,-0.3767941f,-0.0630885f,-0.155981f,0.0395355f,0.3978243f};*/ + + float la[15*16*1*1],lb[15*16*1*1],sig[15*1*1]; + + slevina(n,cov,128,1,la,sig,lb); + + +/* for (i=0;i<15*16*2*2;i++){ + printf("indice : %d valeur : %f - ",i,la[i]); + printf("\n"); + if((i+1)%64==0)printf("------------------------------------\n"); + if((i+1)%16==0)printf("###############\n"); + } + printf("\n"); + printf("\n"); + printf("\n"); + for (i=0;i<15;i++){ + printf("i : %d - lb = ",i); + for (j=0;j<15;j++) printf(" %f - ",lb[15*i+j]); + printf("\n"); + } + printf("\n"); + printf("\n"); + printf("\n"); + + + for (i=0;i<15*1;i++){ + printf("indice : %d %f\n",i,sig[i]); + } +*/ + +} + + + +static int levinTest(void) { + printf("\n>>>> Levin Tests\n"); + slevinaTest(); + return 0; +} + +int main(void) { + assert( levinTest()== 0); + return 0; +} |