signal_processing plugged. 33/4333/7
Cedric Delamarre [Mon, 27 Jun 2011 13:21:18 +0000 (15:21 +0200)]
Change-Id: I35115f8dc88611994d102303eb2e24d1bf4eaf07

63 files changed:
scilab/Scilab.sln
scilab/etc/modules.xml.in
scilab/etc/modules.xml.vc
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/functions_manager/Makefile.am
scilab/modules/functions_manager/Makefile.in
scilab/modules/functions_manager/functions_manager.vcxproj
scilab/modules/functions_manager/includes/module_declaration.hxx
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/signal_processing/Makefile.am
scilab/modules/signal_processing/Makefile.in
scilab/modules/signal_processing/includes/dynlib_signal_processing_gw.h [new file with mode: 0644]
scilab/modules/signal_processing/includes/gw_signal.h
scilab/modules/signal_processing/includes/signal_gw.hxx [new file with mode: 0644]
scilab/modules/signal_processing/sci_gateway/c/sci_amell.c
scilab/modules/signal_processing/sci_gateway/c/sci_corr.c [deleted file]
scilab/modules/signal_processing/sci_gateway/c/sci_delip.c [deleted file]
scilab/modules/signal_processing/sci_gateway/c/sci_fft.c [deleted file]
scilab/modules/signal_processing/sci_gateway/c/sci_remez.c
scilab/modules/signal_processing/sci_gateway/c/sci_rpem.c [deleted file]
scilab/modules/signal_processing/sci_gateway/c/sci_syredi.c [deleted file]
scilab/modules/signal_processing/sci_gateway/cpp/sci_corr.cpp [new file with mode: 0644]
scilab/modules/signal_processing/sci_gateway/cpp/sci_delip.cpp [new file with mode: 0644]
scilab/modules/signal_processing/sci_gateway/cpp/sci_fft.cpp [new file with mode: 0644]
scilab/modules/signal_processing/sci_gateway/cpp/sci_rpem.cpp [new file with mode: 0644]
scilab/modules/signal_processing/sci_gateway/cpp/sci_syredi.cpp [new file with mode: 0644]
scilab/modules/signal_processing/sci_gateway/cpp/signal_gw.cpp [new file with mode: 0644]
scilab/modules/signal_processing/sci_gateway/cpp/signal_processing_gw.vcxproj [new file with mode: 0644]
scilab/modules/signal_processing/sci_gateway/cpp/signal_processing_gw.vcxproj.filters [new file with mode: 0644]
scilab/modules/signal_processing/src/c/Libscilab_Import.def
scilab/modules/signal_processing/src/c/signal_processing.vcxproj
scilab/modules/signal_processing/src/c/signal_processing.vcxproj.filters
scilab/modules/signal_processing/tests/unit_tests/amell.tst
scilab/modules/signal_processing/tests/unit_tests/corr.tst
scilab/modules/signal_processing/tests/unit_tests/corr_fft_ref.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/corr_fft_ref.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/corr_updates_ref.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/corr_updates_ref.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/delip.tst
scilab/modules/signal_processing/tests/unit_tests/fft.tst
scilab/modules/signal_processing/tests/unit_tests/fft_1dim.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/fft_1dim.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/fft_2dim.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/fft_2dim.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/fft_ndim.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/fft_ndim.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/remez.dia.ref
scilab/modules/signal_processing/tests/unit_tests/remez.tst
scilab/modules/signal_processing/tests/unit_tests/rpem.dia.ref
scilab/modules/signal_processing/tests/unit_tests/rpem.tst
scilab/modules/signal_processing/tests/unit_tests/rpem_ref1.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/rpem_ref1.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/rpem_ref2.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/rpem_ref2.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/rpem_ref3.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/rpem_ref3.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/rpem_ref4.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/rpem_ref4.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/syredi.dat [deleted file]
scilab/modules/signal_processing/tests/unit_tests/syredi.h5 [new file with mode: 0644]
scilab/modules/signal_processing/tests/unit_tests/syredi.tst
scilab/modules/signal_processing/tests/unit_tests/test_utilities.sci [deleted file]
scilab/modules/types/typesmacro/typesmacro.vcxproj

index 61f60d3..664a364 100644 (file)
@@ -237,6 +237,9 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arnoldi", "modules\arnoldi\arnoldi.vcxproj", "{D575A6BA-094A-45EC-8F8D-2DF7A2C37AA6}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "signal_processing", "modules\signal_processing\src\c\signal_processing.vcxproj", "{A3AD381E-C0DD-45BB-ACB2-C0A0DB33A606}"
+       ProjectSection(ProjectDependencies) = postProject
+               {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D} = {DBC45B0D-6E0A-4107-B284-5A3B0C5BB50D}
+       EndProjectSection
 EndProject
 Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "cacsd_f", "modules\cacsd\src\fortran\cacsd_f.vfproj", "{0BB16C71-0FCD-4FB9-B7C0-F2601330C980}"
        ProjectSection(ProjectDependencies) = postProject
@@ -646,6 +649,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "noui_data", "modules\ui_dat
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "console_gw", "modules\console\sci_gateway\cpp\console_gw.vcxproj", "{273B1F5C-C137-46D1-B516-FFE5764FABE5}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "signal_processing_gw", "modules\signal_processing\sci_gateway\cpp\signal_processing_gw.vcxproj", "{A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}"
+       ProjectSection(ProjectDependencies) = postProject
+               {959384FC-016C-4B01-B848-1B18D26B6CC4} = {959384FC-016C-4B01-B848-1B18D26B6CC4}
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -2066,6 +2074,14 @@ Global
                {273B1F5C-C137-46D1-B516-FFE5764FABE5}.Release|Win32.Build.0 = Release|Win32
                {273B1F5C-C137-46D1-B516-FFE5764FABE5}.Release|x64.ActiveCfg = Release|x64
                {273B1F5C-C137-46D1-B516-FFE5764FABE5}.Release|x64.Build.0 = Release|x64
+               {A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}.Debug|Win32.ActiveCfg = Debug|Win32
+               {A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}.Debug|Win32.Build.0 = Debug|Win32
+               {A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}.Debug|x64.ActiveCfg = Debug|x64
+               {A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}.Debug|x64.Build.0 = Debug|x64
+               {A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}.Release|Win32.ActiveCfg = Release|Win32
+               {A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}.Release|Win32.Build.0 = Release|Win32
+               {A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}.Release|x64.ActiveCfg = Release|x64
+               {A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index a94b488..5c98aa1 100644 (file)
@@ -43,5 +43,6 @@
     <module name="parse" activate="yes"/>
     <module name="console" activate="yes"/>
     <module name="modules_manager" activate="yes"/>
+    <module name="signal_processing" activate="yes"/>
 </modules>
 
index 3045d6c..64efaa1 100644 (file)
@@ -44,5 +44,6 @@
     <module name="parse" activate="yes"/>
     <module name="console" activate="yes"/>
     <module name="modules_manager" activate="yes"/>
+    <module name="signal_processing" activate="yes"/>
 </modules>
 
index bffc262..0bf0e6e 100644 (file)
@@ -15,7 +15,8 @@
 
 
 #include "internal.hxx"
-#include "arrayof.hxx"
+#include "double.hxx"
+#include "polynom.hxx"
 #include "function.hxx"
 
 extern "C"
@@ -307,20 +308,19 @@ int isVarComplex(void* _pvCtx, int* _piAddress)
         return 0;
     }
 
-/*
-  getVarType(_pvCtx, _piAddress, &iType);
-  switch(iType)
-  {
-  case sci_matrix :
-  iComplex = ((types::InternalType*)(_piAddress))->getAsDouble()->isComplex();
-  break;
-  case sci_poly :
-  iComplex = ((types::InternalType*)_piAddress)->getAs<types::Polynom>()->isComplex();
-  case sci_sparse :
-  //iComplex = ((InternalType*)_piAddress)->getAsSparse()->isComplex();
-  break;
-  }
-*/
+
+    getVarType(_pvCtx, _piAddress, &iType);
+    switch(iType)
+    {
+    case sci_matrix :
+        iComplex = ((types::InternalType*)_piAddress)->getAs<Double>()->isComplex();
+        break;
+    case sci_poly :
+        iComplex = ((types::InternalType*)_piAddress)->getAs<Polynom>()->isComplex();
+    case sci_sparse :
+        //iComplex = ((InternalType*)_piAddress)->getAsSparse()->isComplex();
+        break;
+    }
     return iComplex;
 }
 /*--------------------------------------------------------------------------*/
index 4614406..4d44e58 100644 (file)
@@ -30,11 +30,13 @@ libscifunctions_manager_la_CXXFLAGS =       -I$(top_builddir)/modules/types/includes/
                                                -I$(top_builddir)/modules/output_stream/includes/ \
                                                -I$(top_builddir)/modules/threads/includes/ \
                                                -I$(top_builddir)/modules/console/includes/ \
+                                               -I$(top_builddir)/modules/signal_processing/includes/ \
                                                -Iincludes/ \
                                                $(XML_FLAGS)
 
 libscifunctions_manager_la_LIBADD = $(top_builddir)/modules/elementary_functions/libscielementary_functions.la \
-                                       $(top_builddir)/modules/matio/libscimatio.la
+                                       $(top_builddir)/modules/matio/libscimatio.la \
+                                       $(top_builddir)/modules/signal_processing/libscisignal_processing.la
 
 libscifunctions_manager_la_includedir=$(pkgincludedir)/Types
 
index 1fe61b6..03dea24 100644 (file)
@@ -87,7 +87,8 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" \
        "$(DESTDIR)$(libscifunctions_manager_la_includedir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libscifunctions_manager_la_DEPENDENCIES = $(top_builddir)/modules/elementary_functions/libscielementary_functions.la \
-       $(top_builddir)/modules/matio/libscimatio.la
+       $(top_builddir)/modules/matio/libscimatio.la \
+       $(top_builddir)/modules/signal_processing/libscisignal_processing.la
 am__objects_1 = libscifunctions_manager_la-funcmanager.lo
 am_libscifunctions_manager_la_OBJECTS = $(am__objects_1)
 libscifunctions_manager_la_OBJECTS =  \
@@ -407,11 +408,13 @@ libscifunctions_manager_la_CXXFLAGS = -I$(top_builddir)/modules/types/includes/
                                                -I$(top_builddir)/modules/output_stream/includes/ \
                                                -I$(top_builddir)/modules/threads/includes/ \
                                                -I$(top_builddir)/modules/console/includes/ \
+                                               -I$(top_builddir)/modules/signal_processing/includes/ \
                                                -Iincludes/ \
                                                $(XML_FLAGS)
 
 libscifunctions_manager_la_LIBADD = $(top_builddir)/modules/elementary_functions/libscielementary_functions.la \
-                                       $(top_builddir)/modules/matio/libscimatio.la
+                                       $(top_builddir)/modules/matio/libscimatio.la \
+                                       $(top_builddir)/modules/signal_processing/libscisignal_processing.la
 
 libscifunctions_manager_la_includedir = $(pkgincludedir)/Types
 libscifunctions_manager_la_include_HEADERS = 
index 0278fa3..3a40d04 100644 (file)
       <Project>{bae68b54-2c1a-44d0-a0e9-05156a784e79}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\signal_processing\sci_gateway\cpp\signal_processing_gw.vcxproj">
+      <Project>{a968a82e-b2dc-4ed2-bd9b-12c1e97abbb4}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\string\sci_gateway\cpp\string_gw.vcxproj">
       <Project>{aec1f7b5-28f2-4c1f-a436-98d0352fd3f5}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 4744e48..e0eda7a 100644 (file)
@@ -36,5 +36,6 @@
 #include "../../action_binding/includes/action_binding_gw.hxx"
 #include "../../history_manager/includes/history_manager_gw.hxx"
 #include "../../console/includes/console_gw.hxx"
+#include "../../signal_processing/includes/signal_gw.hxx"
 
 #endif /* !__MODULE_DECLARATION_HXX__ */
index b1b0ecd..e3be038 100644 (file)
@@ -304,6 +304,7 @@ bool FuncManager::CreateModuleList(void)
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"action_binding", &ActionBindingModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"history_manager", &HistoryManagerModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"console", &ConsoleModule::Load));
+    m_ModuleMap.insert(pair<wstring, GW_MOD>(L"signal_processing", &SignalProcessingModule::Load));
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
         m_ModuleMap.insert(pair<wstring, GW_MOD>(L"jvm", &JvmModule::Load));
index ff99f8a..5c1289f 100644 (file)
 #
 # This file is distributed under the same license as the Scilab package.
 
-SIGNAL_PROCESSING_C_SOURCES = src/c/corrtable.c
-
-SIGNAL_PROCESSING_FORTRAN_SOURCES = src/fortran/degree.f \
-src/fortran/parcha.f \
-src/fortran/ouch.f \
-src/fortran/dfftbi.f \
-src/fortran/dsqrtc.f \
-src/fortran/tranze.f \
-src/fortran/chebc.f \
-src/fortran/tscccf.f \
-src/fortran/dsn2.f \
-src/fortran/hammin.f \
-src/fortran/bounn.f \
-src/fortran/nstabl.f \
-src/fortran/ino.f \
-src/fortran/desia.f \
-src/fortran/desi11.f \
-src/fortran/cmpse3.f \
-src/fortran/cheby.f \
-src/fortran/trbize.f \
-src/fortran/r2tx.f \
-src/fortran/deli2.f \
-src/fortran/gee.f \
-src/fortran/r4tx.f \
-src/fortran/transn.f \
-src/fortran/r8tx.f \
-src/fortran/kaiser.f \
-src/fortran/deli11.f \
-src/fortran/compel.f \
-src/fortran/filbut.f \
-src/fortran/desi01.f \
-src/fortran/desi22.f \
-src/fortran/amell.f \
-src/fortran/desi24.f \
-src/fortran/dellk.f \
-src/fortran/syredi.f \
-src/fortran/dpspln.f \
-src/fortran/coeft.f \
-src/fortran/tranpo.f \
-src/fortran/blnumz.f \
-src/fortran/sn.f \
-src/fortran/bldenz.f \
-src/fortran/dspln.f \
-src/fortran/belan.f \
-src/fortran/desib.f \
-src/fortran/freque.f \
-src/fortran/desi12.f \
-src/fortran/cmpse2.f \
-src/fortran/desi14.f \
-src/fortran/delip.f \
-src/fortran/deli1.f \
-src/fortran/trbipo.f \
-src/fortran/rpem.f \
-src/fortran/dfft2.f \
-src/fortran/dgee01.f \
-src/fortran/romeg.f \
-src/fortran/snell.f \
-src/fortran/fft842.f \
-src/fortran/tg02ad.f \
-src/fortran/remez.f \
-src/fortran/poles.f \
-src/fortran/desi00.f \
-src/fortran/desi21.f \
-src/fortran/dfftmx.f
-
-GATEWAY_C_SOURCES = sci_gateway/c/sci_remez.c \
-sci_gateway/c/sci_rpem.c \
-sci_gateway/c/sci_corr.c \
-sci_gateway/c/sci_amell.c \
-sci_gateway/c/gw_signal.c \
-sci_gateway/c/sci_delip.c \
-sci_gateway/c/sci_fft.c \
-sci_gateway/c/sci_syredi.c
-
-GATEWAY_FORTRAN_SOURCES =  sci_gateway/fortran/bgetx.f \
-sci_gateway/fortran/bgety.f \
-sci_gateway/fortran/Ex-corr.f
-
-libscisignal_processing_la_CFLAGS=     -I$(srcdir)/includes/ \
-                                       -I$(top_srcdir)/modules/output_stream/includes \
-                                       -I$(top_srcdir)/modules/dynamic_link/includes \
-                                       -I$(top_srcdir)/modules/api_scilab/includes \
-                                       -I$(top_srcdir)/modules/statistics/includes \
-                                       -I$(top_srcdir)/modules/operations/includes
+SIGNAL_PROCESSING_C_SOURCES = \
+    src/c/corrtable.c
+
+SIGNAL_PROCESSING_FORTRAN_SOURCES = \
+    src/fortran/degree.f \
+    src/fortran/parcha.f \
+    src/fortran/ouch.f \
+    src/fortran/dfftbi.f \
+    src/fortran/dsqrtc.f \
+    src/fortran/tranze.f \
+    src/fortran/chebc.f \
+    src/fortran/tscccf.f \
+    src/fortran/dsn2.f \
+    src/fortran/hammin.f \
+    src/fortran/bounn.f \
+    src/fortran/nstabl.f \
+    src/fortran/ino.f \
+    src/fortran/desia.f \
+    src/fortran/desi11.f \
+    src/fortran/cmpse3.f \
+    src/fortran/cheby.f \
+    src/fortran/trbize.f \
+    src/fortran/r2tx.f \
+    src/fortran/deli2.f \
+    src/fortran/gee.f \
+    src/fortran/r4tx.f \
+    src/fortran/transn.f \
+    src/fortran/r8tx.f \
+    src/fortran/kaiser.f \
+    src/fortran/deli11.f \
+    src/fortran/compel.f \
+    src/fortran/filbut.f \
+    src/fortran/desi01.f \
+    src/fortran/desi22.f \
+    src/fortran/amell.f \
+    src/fortran/desi24.f \
+    src/fortran/dellk.f \
+    src/fortran/syredi.f \
+    src/fortran/dpspln.f \
+    src/fortran/coeft.f \
+    src/fortran/tranpo.f \
+    src/fortran/blnumz.f \
+    src/fortran/sn.f \
+    src/fortran/bldenz.f \
+    src/fortran/dspln.f \
+    src/fortran/belan.f \
+    src/fortran/desib.f \
+    src/fortran/freque.f \
+    src/fortran/desi12.f \
+    src/fortran/cmpse2.f \
+    src/fortran/desi14.f \
+    src/fortran/delip.f \
+    src/fortran/deli1.f \
+    src/fortran/trbipo.f \
+    src/fortran/rpem.f \
+    src/fortran/dfft2.f \
+    src/fortran/dgee01.f \
+    src/fortran/romeg.f \
+    src/fortran/snell.f \
+    src/fortran/fft842.f \
+    src/fortran/tg02ad.f \
+    src/fortran/remez.f \
+    src/fortran/poles.f \
+    src/fortran/desi00.f \
+    src/fortran/desi21.f \
+    src/fortran/dfftmx.f
+
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/signal_gw.cpp \
+    sci_gateway/cpp/sci_rpem.cpp \
+    sci_gateway/cpp/sci_corr.cpp \
+    sci_gateway/cpp/sci_delip.cpp \
+    sci_gateway/cpp/sci_fft.cpp \
+    sci_gateway/cpp/sci_syredi.cpp
+
+GATEWAY_C_SOURCES = \
+    sci_gateway/c/sci_remez.c \
+    sci_gateway/c/sci_amell.c
+
+GATEWAY_FORTRAN_SOURCES = \
+    sci_gateway/fortran/bgetx.f \
+    sci_gateway/fortran/bgety.f \
+    sci_gateway/fortran/Ex-corr.f
+
+libscisignal_processing_la_CFLAGS= \
+    -I$(srcdir)/includes/ \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/dynamic_link/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/statistics/includes \
+    -I$(top_srcdir)/modules/operations/includes
+
+libscisignal_processing_la_CPPFLAGS= \
+    -I$(srcdir)/includes/ \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/elementary_functions/includes \
+    -I$(top_srcdir)/modules/types/includes \
+    -I$(top_srcdir)/modules/ast/includes \
+    -I$(top_srcdir)/modules/functions_manager/includes \
+    -I$(top_srcdir)/modules/operations/includes \
+    -I$(top_srcdir)/modules/symbol/includes
 
 pkglib_LTLIBRARIES = libscisignal_processing.la
 noinst_LTLIBRARIES = libscisignal_processing-algo.la
@@ -94,14 +111,14 @@ noinst_LTLIBRARIES = libscisignal_processing-algo.la
 libscisignal_processing_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
 
 libscisignal_processing_algo_la_SOURCES = $(SIGNAL_PROCESSING_FORTRAN_SOURCES) $(SIGNAL_PROCESSING_C_SOURCES)
-libscisignal_processing_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscisignal_processing_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES) $(GATEWAY_CPP_SOURCES)
 libscisignal_processing_algo_la_CFLAGS = $(libscisignal_processing_la_CFLAGS)
 
 # For the code check (splint)
 CHECK_SRC= $(SIGNAL_PROCESSING_C_SOURCES) $(GATEWAY_C_SOURCES)
 INCLUDE_FLAGS = $(libscisignal_processing_la_CFLAGS)
 
-libscisignal_processing_la_LIBADD = libscisignal_processing-algo.la $(top_builddir)/modules/elementary_functions/libscielementary_functions.la $(top_builddir)/modules/dynamic_link/libscidynamic_link.la $(top_builddir)/modules/arnoldi/libsciarnoldi.la  $(top_builddir)/modules/output_stream/libscioutput_stream.la
+libscisignal_processing_la_LIBADD = libscisignal_processing-algo.la $(top_builddir)/modules/elementary_functions/libscielementary_functions.la $(top_builddir)/modules/dynamic_link/libscidynamic_link.la $(top_builddir)/modules/arnoldi/libsciarnoldi.la $(top_builddir)/modules/output_stream/libscioutput_stream.la
 
 #### Target ######
 modulename=signal_processing
index d243e85..95ff659 100644 (file)
@@ -135,22 +135,22 @@ libscisignal_processing_la_DEPENDENCIES =  \
        $(top_builddir)/modules/arnoldi/libsciarnoldi.la \
        $(top_builddir)/modules/output_stream/libscioutput_stream.la
 am__objects_3 = libscisignal_processing_la-sci_remez.lo \
+       libscisignal_processing_la-sci_amell.lo
+am__objects_4 = bgetx.lo bgety.lo Ex-corr.lo
+am__objects_5 = libscisignal_processing_la-signal_gw.lo \
        libscisignal_processing_la-sci_rpem.lo \
        libscisignal_processing_la-sci_corr.lo \
-       libscisignal_processing_la-sci_amell.lo \
-       libscisignal_processing_la-gw_signal.lo \
        libscisignal_processing_la-sci_delip.lo \
        libscisignal_processing_la-sci_fft.lo \
        libscisignal_processing_la-sci_syredi.lo
-am__objects_4 = bgetx.lo bgety.lo Ex-corr.lo
 am_libscisignal_processing_la_OBJECTS = $(am__objects_3) \
-       $(am__objects_4)
+       $(am__objects_4) $(am__objects_5)
 libscisignal_processing_la_OBJECTS =  \
        $(am_libscisignal_processing_la_OBJECTS)
-libscisignal_processing_la_LINK = $(LIBTOOL) --tag=F77 \
-       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(F77LD) \
-       $(AM_FFLAGS) $(FFLAGS) $(libscisignal_processing_la_LDFLAGS) \
-       $(LDFLAGS) -o $@
+libscisignal_processing_la_LINK = $(LIBTOOL) --tag=CXX \
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+       $(AM_CXXFLAGS) $(CXXFLAGS) \
+       $(libscisignal_processing_la_LDFLAGS) $(LDFLAGS) -o $@
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -164,6 +164,15 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)
 LTF77COMPILE = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)
@@ -441,101 +450,119 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
-SIGNAL_PROCESSING_C_SOURCES = src/c/corrtable.c
-SIGNAL_PROCESSING_FORTRAN_SOURCES = src/fortran/degree.f \
-src/fortran/parcha.f \
-src/fortran/ouch.f \
-src/fortran/dfftbi.f \
-src/fortran/dsqrtc.f \
-src/fortran/tranze.f \
-src/fortran/chebc.f \
-src/fortran/tscccf.f \
-src/fortran/dsn2.f \
-src/fortran/hammin.f \
-src/fortran/bounn.f \
-src/fortran/nstabl.f \
-src/fortran/ino.f \
-src/fortran/desia.f \
-src/fortran/desi11.f \
-src/fortran/cmpse3.f \
-src/fortran/cheby.f \
-src/fortran/trbize.f \
-src/fortran/r2tx.f \
-src/fortran/deli2.f \
-src/fortran/gee.f \
-src/fortran/r4tx.f \
-src/fortran/transn.f \
-src/fortran/r8tx.f \
-src/fortran/kaiser.f \
-src/fortran/deli11.f \
-src/fortran/compel.f \
-src/fortran/filbut.f \
-src/fortran/desi01.f \
-src/fortran/desi22.f \
-src/fortran/amell.f \
-src/fortran/desi24.f \
-src/fortran/dellk.f \
-src/fortran/syredi.f \
-src/fortran/dpspln.f \
-src/fortran/coeft.f \
-src/fortran/tranpo.f \
-src/fortran/blnumz.f \
-src/fortran/sn.f \
-src/fortran/bldenz.f \
-src/fortran/dspln.f \
-src/fortran/belan.f \
-src/fortran/desib.f \
-src/fortran/freque.f \
-src/fortran/desi12.f \
-src/fortran/cmpse2.f \
-src/fortran/desi14.f \
-src/fortran/delip.f \
-src/fortran/deli1.f \
-src/fortran/trbipo.f \
-src/fortran/rpem.f \
-src/fortran/dfft2.f \
-src/fortran/dgee01.f \
-src/fortran/romeg.f \
-src/fortran/snell.f \
-src/fortran/fft842.f \
-src/fortran/tg02ad.f \
-src/fortran/remez.f \
-src/fortran/poles.f \
-src/fortran/desi00.f \
-src/fortran/desi21.f \
-src/fortran/dfftmx.f
-
-GATEWAY_C_SOURCES = sci_gateway/c/sci_remez.c \
-sci_gateway/c/sci_rpem.c \
-sci_gateway/c/sci_corr.c \
-sci_gateway/c/sci_amell.c \
-sci_gateway/c/gw_signal.c \
-sci_gateway/c/sci_delip.c \
-sci_gateway/c/sci_fft.c \
-sci_gateway/c/sci_syredi.c
-
-GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/bgetx.f \
-sci_gateway/fortran/bgety.f \
-sci_gateway/fortran/Ex-corr.f
-
-libscisignal_processing_la_CFLAGS = -I$(srcdir)/includes/ \
-                                       -I$(top_srcdir)/modules/output_stream/includes \
-                                       -I$(top_srcdir)/modules/dynamic_link/includes \
-                                       -I$(top_srcdir)/modules/api_scilab/includes \
-                                       -I$(top_srcdir)/modules/statistics/includes \
-                                       -I$(top_srcdir)/modules/operations/includes
+SIGNAL_PROCESSING_C_SOURCES = \
+    src/c/corrtable.c
+
+SIGNAL_PROCESSING_FORTRAN_SOURCES = \
+    src/fortran/degree.f \
+    src/fortran/parcha.f \
+    src/fortran/ouch.f \
+    src/fortran/dfftbi.f \
+    src/fortran/dsqrtc.f \
+    src/fortran/tranze.f \
+    src/fortran/chebc.f \
+    src/fortran/tscccf.f \
+    src/fortran/dsn2.f \
+    src/fortran/hammin.f \
+    src/fortran/bounn.f \
+    src/fortran/nstabl.f \
+    src/fortran/ino.f \
+    src/fortran/desia.f \
+    src/fortran/desi11.f \
+    src/fortran/cmpse3.f \
+    src/fortran/cheby.f \
+    src/fortran/trbize.f \
+    src/fortran/r2tx.f \
+    src/fortran/deli2.f \
+    src/fortran/gee.f \
+    src/fortran/r4tx.f \
+    src/fortran/transn.f \
+    src/fortran/r8tx.f \
+    src/fortran/kaiser.f \
+    src/fortran/deli11.f \
+    src/fortran/compel.f \
+    src/fortran/filbut.f \
+    src/fortran/desi01.f \
+    src/fortran/desi22.f \
+    src/fortran/amell.f \
+    src/fortran/desi24.f \
+    src/fortran/dellk.f \
+    src/fortran/syredi.f \
+    src/fortran/dpspln.f \
+    src/fortran/coeft.f \
+    src/fortran/tranpo.f \
+    src/fortran/blnumz.f \
+    src/fortran/sn.f \
+    src/fortran/bldenz.f \
+    src/fortran/dspln.f \
+    src/fortran/belan.f \
+    src/fortran/desib.f \
+    src/fortran/freque.f \
+    src/fortran/desi12.f \
+    src/fortran/cmpse2.f \
+    src/fortran/desi14.f \
+    src/fortran/delip.f \
+    src/fortran/deli1.f \
+    src/fortran/trbipo.f \
+    src/fortran/rpem.f \
+    src/fortran/dfft2.f \
+    src/fortran/dgee01.f \
+    src/fortran/romeg.f \
+    src/fortran/snell.f \
+    src/fortran/fft842.f \
+    src/fortran/tg02ad.f \
+    src/fortran/remez.f \
+    src/fortran/poles.f \
+    src/fortran/desi00.f \
+    src/fortran/desi21.f \
+    src/fortran/dfftmx.f
+
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/signal_gw.cpp \
+    sci_gateway/cpp/sci_rpem.cpp \
+    sci_gateway/cpp/sci_corr.cpp \
+    sci_gateway/cpp/sci_delip.cpp \
+    sci_gateway/cpp/sci_fft.cpp \
+    sci_gateway/cpp/sci_syredi.cpp
+
+GATEWAY_C_SOURCES = \
+    sci_gateway/c/sci_remez.c \
+    sci_gateway/c/sci_amell.c
+
+GATEWAY_FORTRAN_SOURCES = \
+    sci_gateway/fortran/bgetx.f \
+    sci_gateway/fortran/bgety.f \
+    sci_gateway/fortran/Ex-corr.f
+
+libscisignal_processing_la_CFLAGS = \
+    -I$(srcdir)/includes/ \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/dynamic_link/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/statistics/includes \
+    -I$(top_srcdir)/modules/operations/includes
+
+libscisignal_processing_la_CPPFLAGS = \
+    -I$(srcdir)/includes/ \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/elementary_functions/includes \
+    -I$(top_srcdir)/modules/types/includes \
+    -I$(top_srcdir)/modules/ast/includes \
+    -I$(top_srcdir)/modules/functions_manager/includes \
+    -I$(top_srcdir)/modules/operations/includes \
+    -I$(top_srcdir)/modules/symbol/includes
 
 pkglib_LTLIBRARIES = libscisignal_processing.la
 noinst_LTLIBRARIES = libscisignal_processing-algo.la
 libscisignal_processing_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
 libscisignal_processing_algo_la_SOURCES = $(SIGNAL_PROCESSING_FORTRAN_SOURCES) $(SIGNAL_PROCESSING_C_SOURCES)
-libscisignal_processing_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscisignal_processing_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES) $(GATEWAY_CPP_SOURCES)
 libscisignal_processing_algo_la_CFLAGS = $(libscisignal_processing_la_CFLAGS)
 
 # For the code check (splint)
 CHECK_SRC = $(SIGNAL_PROCESSING_C_SOURCES) $(GATEWAY_C_SOURCES)
 INCLUDE_FLAGS = $(libscisignal_processing_la_CFLAGS)
-libscisignal_processing_la_LIBADD = libscisignal_processing-algo.la $(top_builddir)/modules/elementary_functions/libscielementary_functions.la $(top_builddir)/modules/dynamic_link/libscidynamic_link.la $(top_builddir)/modules/arnoldi/libsciarnoldi.la  $(top_builddir)/modules/output_stream/libscioutput_stream.la
+libscisignal_processing_la_LIBADD = libscisignal_processing-algo.la $(top_builddir)/modules/elementary_functions/libscielementary_functions.la $(top_builddir)/modules/dynamic_link/libscidynamic_link.la $(top_builddir)/modules/arnoldi/libsciarnoldi.la $(top_builddir)/modules/output_stream/libscioutput_stream.la
 
 #### Target ######
 modulename = signal_processing
@@ -621,7 +648,7 @@ HELP_CHAPTERLANG = en_US fr_FR pt_BR
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .sci .bin .c .f .lo .o .obj
+.SUFFIXES: .sci .bin .c .cpp .f .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -704,7 +731,6 @@ distclean-compile:
        -rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_algo_la-corrtable.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_la-gw_signal.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_la-sci_amell.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_la-sci_corr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_la-sci_delip.Plo@am__quote@
@@ -712,6 +738,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_la-sci_remez.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_la-sci_rpem.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_la-sci_syredi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisignal_processing_la-signal_gw.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -742,60 +769,81 @@ libscisignal_processing_algo_la-corrtable.lo: src/c/corrtable.c
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_algo_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_algo_la-corrtable.lo `test -f 'src/c/corrtable.c' || echo '$(srcdir)/'`src/c/corrtable.c
 
 libscisignal_processing_la-sci_remez.lo: sci_gateway/c/sci_remez.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_remez.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_remez.Tpo -c -o libscisignal_processing_la-sci_remez.lo `test -f 'sci_gateway/c/sci_remez.c' || echo '$(srcdir)/'`sci_gateway/c/sci_remez.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_remez.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_remez.Tpo -c -o libscisignal_processing_la-sci_remez.lo `test -f 'sci_gateway/c/sci_remez.c' || echo '$(srcdir)/'`sci_gateway/c/sci_remez.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_remez.Tpo $(DEPDIR)/libscisignal_processing_la-sci_remez.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_remez.c' object='libscisignal_processing_la-sci_remez.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) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_remez.lo `test -f 'sci_gateway/c/sci_remez.c' || echo '$(srcdir)/'`sci_gateway/c/sci_remez.c
-
-libscisignal_processing_la-sci_rpem.lo: sci_gateway/c/sci_rpem.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_rpem.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_rpem.Tpo -c -o libscisignal_processing_la-sci_rpem.lo `test -f 'sci_gateway/c/sci_rpem.c' || echo '$(srcdir)/'`sci_gateway/c/sci_rpem.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_rpem.Tpo $(DEPDIR)/libscisignal_processing_la-sci_rpem.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_rpem.c' object='libscisignal_processing_la-sci_rpem.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) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_rpem.lo `test -f 'sci_gateway/c/sci_rpem.c' || echo '$(srcdir)/'`sci_gateway/c/sci_rpem.c
-
-libscisignal_processing_la-sci_corr.lo: sci_gateway/c/sci_corr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_corr.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_corr.Tpo -c -o libscisignal_processing_la-sci_corr.lo `test -f 'sci_gateway/c/sci_corr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_corr.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_corr.Tpo $(DEPDIR)/libscisignal_processing_la-sci_corr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_corr.c' object='libscisignal_processing_la-sci_corr.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) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_corr.lo `test -f 'sci_gateway/c/sci_corr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_corr.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_remez.lo `test -f 'sci_gateway/c/sci_remez.c' || echo '$(srcdir)/'`sci_gateway/c/sci_remez.c
 
 libscisignal_processing_la-sci_amell.lo: sci_gateway/c/sci_amell.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_amell.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_amell.Tpo -c -o libscisignal_processing_la-sci_amell.lo `test -f 'sci_gateway/c/sci_amell.c' || echo '$(srcdir)/'`sci_gateway/c/sci_amell.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_amell.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_amell.Tpo -c -o libscisignal_processing_la-sci_amell.lo `test -f 'sci_gateway/c/sci_amell.c' || echo '$(srcdir)/'`sci_gateway/c/sci_amell.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_amell.Tpo $(DEPDIR)/libscisignal_processing_la-sci_amell.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_amell.c' object='libscisignal_processing_la-sci_amell.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) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_amell.lo `test -f 'sci_gateway/c/sci_amell.c' || echo '$(srcdir)/'`sci_gateway/c/sci_amell.c
-
-libscisignal_processing_la-gw_signal.lo: sci_gateway/c/gw_signal.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-gw_signal.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-gw_signal.Tpo -c -o libscisignal_processing_la-gw_signal.lo `test -f 'sci_gateway/c/gw_signal.c' || echo '$(srcdir)/'`sci_gateway/c/gw_signal.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscisignal_processing_la-gw_signal.Tpo $(DEPDIR)/libscisignal_processing_la-gw_signal.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/gw_signal.c' object='libscisignal_processing_la-gw_signal.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) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-gw_signal.lo `test -f 'sci_gateway/c/gw_signal.c' || echo '$(srcdir)/'`sci_gateway/c/gw_signal.c
-
-libscisignal_processing_la-sci_delip.lo: sci_gateway/c/sci_delip.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_delip.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_delip.Tpo -c -o libscisignal_processing_la-sci_delip.lo `test -f 'sci_gateway/c/sci_delip.c' || echo '$(srcdir)/'`sci_gateway/c/sci_delip.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_delip.Tpo $(DEPDIR)/libscisignal_processing_la-sci_delip.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_delip.c' object='libscisignal_processing_la-sci_delip.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) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_delip.lo `test -f 'sci_gateway/c/sci_delip.c' || echo '$(srcdir)/'`sci_gateway/c/sci_delip.c
-
-libscisignal_processing_la-sci_fft.lo: sci_gateway/c/sci_fft.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_fft.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_fft.Tpo -c -o libscisignal_processing_la-sci_fft.lo `test -f 'sci_gateway/c/sci_fft.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fft.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_fft.Tpo $(DEPDIR)/libscisignal_processing_la-sci_fft.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_fft.c' object='libscisignal_processing_la-sci_fft.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) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_fft.lo `test -f 'sci_gateway/c/sci_fft.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fft.c
-
-libscisignal_processing_la-sci_syredi.lo: sci_gateway/c/sci_syredi.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -MT libscisignal_processing_la-sci_syredi.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_syredi.Tpo -c -o libscisignal_processing_la-sci_syredi.lo `test -f 'sci_gateway/c/sci_syredi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_syredi.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_syredi.Tpo $(DEPDIR)/libscisignal_processing_la-sci_syredi.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_syredi.c' object='libscisignal_processing_la-sci_syredi.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) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_syredi.lo `test -f 'sci_gateway/c/sci_syredi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_syredi.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(libscisignal_processing_la_CFLAGS) $(CFLAGS) -c -o libscisignal_processing_la-sci_amell.lo `test -f 'sci_gateway/c/sci_amell.c' || echo '$(srcdir)/'`sci_gateway/c/sci_amell.c
+
+.cpp.o:
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@  $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+libscisignal_processing_la-signal_gw.lo: sci_gateway/cpp/signal_gw.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscisignal_processing_la-signal_gw.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-signal_gw.Tpo -c -o libscisignal_processing_la-signal_gw.lo `test -f 'sci_gateway/cpp/signal_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/signal_gw.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscisignal_processing_la-signal_gw.Tpo $(DEPDIR)/libscisignal_processing_la-signal_gw.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/signal_gw.cpp' object='libscisignal_processing_la-signal_gw.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscisignal_processing_la-signal_gw.lo `test -f 'sci_gateway/cpp/signal_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/signal_gw.cpp
+
+libscisignal_processing_la-sci_rpem.lo: sci_gateway/cpp/sci_rpem.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscisignal_processing_la-sci_rpem.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_rpem.Tpo -c -o libscisignal_processing_la-sci_rpem.lo `test -f 'sci_gateway/cpp/sci_rpem.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_rpem.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_rpem.Tpo $(DEPDIR)/libscisignal_processing_la-sci_rpem.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_rpem.cpp' object='libscisignal_processing_la-sci_rpem.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscisignal_processing_la-sci_rpem.lo `test -f 'sci_gateway/cpp/sci_rpem.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_rpem.cpp
+
+libscisignal_processing_la-sci_corr.lo: sci_gateway/cpp/sci_corr.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscisignal_processing_la-sci_corr.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_corr.Tpo -c -o libscisignal_processing_la-sci_corr.lo `test -f 'sci_gateway/cpp/sci_corr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_corr.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_corr.Tpo $(DEPDIR)/libscisignal_processing_la-sci_corr.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_corr.cpp' object='libscisignal_processing_la-sci_corr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscisignal_processing_la-sci_corr.lo `test -f 'sci_gateway/cpp/sci_corr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_corr.cpp
+
+libscisignal_processing_la-sci_delip.lo: sci_gateway/cpp/sci_delip.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscisignal_processing_la-sci_delip.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_delip.Tpo -c -o libscisignal_processing_la-sci_delip.lo `test -f 'sci_gateway/cpp/sci_delip.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_delip.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_delip.Tpo $(DEPDIR)/libscisignal_processing_la-sci_delip.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_delip.cpp' object='libscisignal_processing_la-sci_delip.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscisignal_processing_la-sci_delip.lo `test -f 'sci_gateway/cpp/sci_delip.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_delip.cpp
+
+libscisignal_processing_la-sci_fft.lo: sci_gateway/cpp/sci_fft.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscisignal_processing_la-sci_fft.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_fft.Tpo -c -o libscisignal_processing_la-sci_fft.lo `test -f 'sci_gateway/cpp/sci_fft.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_fft.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_fft.Tpo $(DEPDIR)/libscisignal_processing_la-sci_fft.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_fft.cpp' object='libscisignal_processing_la-sci_fft.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscisignal_processing_la-sci_fft.lo `test -f 'sci_gateway/cpp/sci_fft.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_fft.cpp
+
+libscisignal_processing_la-sci_syredi.lo: sci_gateway/cpp/sci_syredi.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscisignal_processing_la-sci_syredi.lo -MD -MP -MF $(DEPDIR)/libscisignal_processing_la-sci_syredi.Tpo -c -o libscisignal_processing_la-sci_syredi.lo `test -f 'sci_gateway/cpp/sci_syredi.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_syredi.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscisignal_processing_la-sci_syredi.Tpo $(DEPDIR)/libscisignal_processing_la-sci_syredi.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_syredi.cpp' object='libscisignal_processing_la-sci_syredi.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisignal_processing_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscisignal_processing_la-sci_syredi.lo `test -f 'sci_gateway/cpp/sci_syredi.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_syredi.cpp
 
 .f.o:
        $(F77COMPILE) -c -o $@ $<
diff --git a/scilab/modules/signal_processing/includes/dynlib_signal_processing_gw.h b/scilab/modules/signal_processing/includes/dynlib_signal_processing_gw.h
new file mode 100644 (file)
index 0000000..68cf338
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) DIGITEO - 2009 - Allan CORNET
+* 
+* 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
+*
+*/
+
+/*--------------------------------------------------------------------------*/ 
+#ifndef __DYNLIB_SIGNAL_PROCESSING_GW_H__
+#define __DYNLIB_SIGNAL_PROCESSING_GW_H__
+
+#ifdef _MSC_VER
+       #if SIGNAL_PROCESSING_GW_EXPORTS
+               #define EXTERN_SIGNAL_PROCESSING_GW __declspec (dllexport)
+       #else
+               #define EXTERN_SIGNAL_PROCESSING_GW __declspec (dllimport)
+       #endif
+#else
+       #define EXTERN_SIGNAL_PROCESSING_GW
+#endif
+
+#endif /* __DYNLIB_SIGNAL_PROCESSING_GW_H__ */
+/*--------------------------------------------------------------------------*/ 
+
index 4ad2cb3..aa185b0 100644 (file)
 /*--------------------------------------------------------------------------*/
 #include "dynlib_signal_processing.h"
 #include "machine.h"
+#include "c_gateway_prototype.h"
 /*--------------------------------------------------------------------------*/
 SIGNAL_PROCESSING_IMPEXP int gw_signal_processing(void);
 /*--------------------------------------------------------------------------*/
 
+SIGNAL_PROCESSING_IMPEXP C_GATEWAY_PROTOTYPE(sci_remez);
+//SIGNAL_PROCESSING_IMPEXP C_GATEWAY_PROTOTYPE(sci_rpem); => c++
+//SIGNAL_PROCESSING_IMPEXP C_GATEWAY_PROTOTYPE(sci_corr); -> c++
+//SIGNAL_PROCESSING_IMPEXP C_GATEWAY_PROTOTYPE(sci_fft); -> c++
+SIGNAL_PROCESSING_IMPEXP C_GATEWAY_PROTOTYPE(sci_amell);
+//SIGNAL_PROCESSING_IMPEXP C_GATEWAY_PROTOTYPE(sci_delip); -> c++
+//SIGNAL_PROCESSING_IMPEXP C_GATEWAY_PROTOTYPE(sci_syredi); -> c++
+
+/*
 //YaSp
 SIGNAL_PROCESSING_IMPEXP int sci_remez(char *fname, int* _piKey);
 SIGNAL_PROCESSING_IMPEXP int sci_rpem(char *fname, int* _piKey);
@@ -29,6 +39,7 @@ SIGNAL_PROCESSING_IMPEXP int sci_fiir(char *fname, int* _piKey);
 SIGNAL_PROCESSING_IMPEXP int sci_amell(char *fname, int* _piKey);
 SIGNAL_PROCESSING_IMPEXP int sci_delip(char *fname, int* _piKey);
 SIGNAL_PROCESSING_IMPEXP int sci_syredi(char *fname, int* _piKey);
+*/
 #endif /*  __GW_SIGNAL__ */
 /*--------------------------------------------------------------------------*/
 
diff --git a/scilab/modules/signal_processing/includes/signal_gw.hxx b/scilab/modules/signal_processing/includes/signal_gw.hxx
new file mode 100644 (file)
index 0000000..1ad1d61
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2011 - DIGITEO - Cedric DELAMARRE
+ *
+ *  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
+ *
+ */
+
+#ifndef __SIGNAL_GW_HXX__
+#define __SIGNAL_GW_HXX__
+
+#include "cpp_gateway_prototype.hxx"
+extern "C"
+{
+#include "dynlib_signal_processing_gw.h"
+}
+
+class SignalProcessingModule
+{
+private :
+   SignalProcessingModule(){};
+   ~SignalProcessingModule(){};
+public :
+   EXTERN_SIGNAL_PROCESSING_GW static int Load();
+};
+
+CPP_GATEWAY_PROTOTYPE(sci_rpem);
+CPP_GATEWAY_PROTOTYPE(sci_corr);
+CPP_GATEWAY_PROTOTYPE(sci_delip);
+CPP_GATEWAY_PROTOTYPE(sci_fft);
+CPP_GATEWAY_PROTOTYPE(sci_syredi);
+
+#endif /* !__SIGNAL_GW_HXX__ */
index c9fbaf5..2a61c69 100644 (file)
 
 #include "gw_signal.h"
 
-#include "api_scilab.h"
 #include "stack-c.h"
 #include "Scierror.h"
 #include "localization.h"
 
+#include "api_scilab.h"
+#include "api_oldstack.h"
+
 extern int C2F(amell)(double *du, double *dk, double *dsn2, int *n);
 
 int sci_amell(char *fname, int* _piKey)
diff --git a/scilab/modules/signal_processing/sci_gateway/c/sci_corr.c b/scilab/modules/signal_processing/sci_gateway/c/sci_corr.c
deleted file mode 100644 (file)
index 880afac..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2009 - Digiteo - Vincent LIARD
- *
- * 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 "api_scilab.h"
-#include "MALLOC.h"
-#include "gw_signal.h"
-#include "stack-c.h"
-#include "Scierror.h"
-#include "localization.h"
-#include "../../../statistics/src/c/sci_string_matrix.h"
-
-extern int C2F(scicorr)(char *id,unsigned long fname_len );
-
-int corr_default(char *fname, int* _piKey);
-int corr_updates(char *fname, int* _piKey);
-int corr_fft(char *fname, int* _piKey);
-
-/* dispatch to specialized gateways according to mode (default, 'updt', 'fft') */
-int sci_corr(char *fname, int* _piKey)
-{
-  char *name;
-  int type;
-  int *arg;
-
-  CheckRhs(2,5);
-  CheckLhs(1,2);
-  getVarAddressFromPosition(_piKey, 1, &arg);
-  getVarType(_piKey, arg, &type);
-       if (type == sci_strings) {
-    name = create_string(_piKey, 1);
-    switch (name[0]) {
-    case 'f': /* fft */
-      CheckRhs(4,5);
-      corr_fft(fname, _piKey);
-      break;
-    case 'u': /* updates */
-      CheckRhs(3,5);
-      corr_updates(fname, _piKey);
-      break;
-    default:
-      Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"), fname, 1, "'fft', 'update'");
-      return 1;
-    }
-    destroy_string(name);
-  }
-  else { /* default */
-    CheckRhs(2,3);
-    corr_default(fname, _piKey);
-  }
-  return 0;
-}
-
-int corr_default(char *fname, int* _piKey) {
-
-  extern void C2F(tscccf)(double *x, double *y, int *length,
-                         double *cxy, double *xymean, int *lag, int *error);
-
-  int length, lags_number, error, rows1, cols1, rows2, cols2, rows3, cols3;
-  double *x, *y, *xvar /* crossvariance */, *mean, *data;
-  int *arg;
-  int type;
-
-  getVarAddressFromPosition(_piKey, 1, &arg);
-  getVarDimension(_piKey, arg, &rows1, &cols1);
-  length = rows1 * cols1;
-  getVarType(_piKey, arg, &type);
-  if ((type != sci_matrix) ||
-      (rows1 != 1 && cols1 != 1)) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: A vector expected.\n"), fname, 1);
-    return 1;
-  }
-  getMatrixOfDouble(_piKey, arg, &rows1, &cols1, &x);
-
-  /* interpret 2nd argument according to number of arguments */
-  getVarAddressFromPosition(_piKey, 2, &arg);
-  getMatrixOfDouble(_piKey, arg, &rows2, &cols2, &data);
-  if (Rhs == 2) {
-    if (rows2 != 1 || cols2 != 1) {
-      Scierror(999, _("%s: Wrong size for input argument #%d: A scalar expected.\n"), fname, 2);
-      return 1;
-    }
-    y = x;
-    lags_number = (int)data[0];
-  }
-  else {
-    if (rows1 != rows2 || cols1 != cols2) {
-      Scierror(999, _("%s: Incompatible input arguments #%d and #%d': Same sizes expected.\n"), fname, 1, 2);
-      return 1;
-    }
-    y = data;
-    getVarAddressFromPosition(_piKey, 3, &arg);
-    getMatrixOfDouble(_piKey, arg, &rows3, &cols3, &data);
-    lags_number = (int)data[0];
-  }
-  allocMatrixOfDouble(_piKey, Rhs + 1, 1, lags_number, &xvar);
-  allocMatrixOfDouble(_piKey, Rhs + 2, 1, (x == y) ? 1 : 2, &mean);
-  C2F(tscccf)(x, y, &length, xvar, mean, &lags_number, &error);
-  LhsVar(1) = Rhs + 1;
-  LhsVar(2) = Rhs + 2;
-  PutLhsVar();
-  return error;
-}
-
-int corr_fft(char *fname, int* _piKey) {
-
-  extern void C2F(cmpse2)(int *m, int *n, int *mode,
-                         void (*bgetx)(double *, int *, int *),
-                         void (*bgety)(double *, int *, int *),
-                         double *xa, double *xr, double *xi,
-                         double *zr, double *zi, int *error);
-  extern void C2F(bgetx)(double *x, int *increment, int *start_idx);
-  extern void C2F(bgety)(double *x, int *increment, int *start_idx);
-  extern void C2F(setdgetx)(char *name, int *rep);
-  extern void C2F(setdgety)(char *name, int *rep);
-
-  enum {self = 2, cross = 3} mode = self;
-  int error, rows, cols, n, mm, lag;
-  double *r;
-  double *xa, *xr, *xi, *zr, *zi, *data;
-  int return2_length, one = 1;
-  int *arg;
-
-  /* taken from DllmainSignal_processing.c */
-  /* the very f*** global referred to underneath */
-  extern struct {
-    int kgxtop, kgytop, ksec, kisc;
-  } C2F(corradr);
-
-  getVarAddressFromPosition(_piKey, Rhs, &arg);
-  getMatrixOfDouble(_piKey, arg, &rows, &cols, &data);
-  lag = (int)(*data);
-  mm = 2 * lag;
-  getVarAddressFromPosition(_piKey, Rhs - 1, &arg);
-  getMatrixOfDouble(_piKey, arg, &rows, &cols, &data);
-  n = (int)(*data);
-  mode = (Rhs == 4 ? self : cross);
-
-  /** @todo add code to manage calls to compiled functions */
-
-  /* setting the f*** (!@&£*% etc) global parameter for cmpse2 */
-  C2F(corradr).kgxtop = Top - Rhs + 2;
-  C2F(corradr).kgytop = Top - Rhs + 3; /* useless for self correlation but doesn't hurt */
-  C2F(corradr).ksec = Top;
-  C2F(corradr).kisc = Top + 1;
-
-  xa = (double *)MALLOC(mm * sizeof(double));
-  xr = (double *)MALLOC(mm * sizeof(double));
-  xi = (double *)MALLOC(mm * sizeof(double));
-  zr = (double *)MALLOC(mm * sizeof(double));
-  zi = (double *)MALLOC(mm * sizeof(double));
-  {
-    int imode = mode; /* enum* not equiv to int* :'( */
-    C2F(cmpse2)(&mm, &n, &imode,
-               C2F(bgetx), C2F(bgety),
-               xa, xr, xi, zr, zi, &error);
-  }
-  allocMatrixOfDouble(_piKey, Rhs + 1, 1, lag, &r);
-  C2F(dcopy)(&lag, xa, &one, r, &one);
-
-  LhsVar(1) = Rhs + 1;
-  return2_length = Rhs - 3;
-  allocMatrixOfDouble(_piKey, Rhs + 2, 1, return2_length, &r);
-  C2F(dcopy)(&return2_length, xr, &one, r, &one);
-  FREE(zi);
-  FREE(zr);
-  FREE(xi);
-  FREE(xr);
-  FREE(xa);
-  LhsVar(2) = Rhs + 2;
-  PutLhsVar();
-  return 0;
-}
-
-/* assert: RhsVar must have been checked to hold 4 to 5 elements */
-int corr_updates(char *fname, int* _piKey) {
-
-  extern void C2F(cmpse3)(int *m, int *n, int *mode, double *x, double *y,
-                         double *xr, double *xi,
-                         double *zr, double *zi,
-                         int *error, int *ichaud, int *nbx);
-
-  enum {self = 0, cross = 1} mode = self;
-  int update = 0;
-  int mfft, wpos;
-  int length, error, rows, cols;
-  double *x, *y,
-    *zr, *zi, *wr, *wi, *x_real,
-    *rr, *ri, y_value;
-  int *arg;
-  int one = 1, nbx = 0;
-  double zero = 0L;
-
-  /* x */
-  getVarAddressFromPosition(_piKey, 2, &arg);
-  getMatrixOfDouble(_piKey, arg, &rows, &cols, &x);
-  length = rows * cols;
-  getVarAddressFromPosition(_piKey, 3, &arg);
-  getVarDimension(_piKey, arg, &rows, &cols);
-  if (length == rows * cols) {
-    mode = cross;
-  }
-  if ((mode == cross && Rhs == 5) ||
-      (mode == self && Rhs == 4)) {
-    update = 1;
-  }
-
-  /* y */
-  if (mode == cross) {
-    CheckRhs(4,5);
-    if (isVarComplex(_piKey, arg)) {
-      Scierror(999, _("%s: Input argument #%d must be real.\n"), fname, 3);
-      return 1;
-    }
-    getMatrixOfDouble(_piKey, arg, &rows, &cols, &y);
-  }
-  else {
-    y_value = 0;
-    y = &y_value;
-  }
-
-  /* w */
-  wpos = (mode == self) ? 3 : 4;
-  /* dimension ought to be a power of 2 (could be checked here) */
-  /* GetVarDimension(wpos, &rows, &cols); */
-  getVarAddressFromPosition(_piKey, wpos, &arg);
-  if (isVarComplex(_piKey, arg)) {
-    getComplexMatrixOfDouble(_piKey, arg, &rows, &cols, &zr, &zi);
-    mfft = rows * cols;
-  }
-  else {
-    getMatrixOfDouble(_piKey, arg, &rows, &cols, &zr);
-    mfft = rows * cols;
-    zi = (double *)MALLOC(mfft * sizeof(double));
-    C2F(dset)(&mfft, &zero, zi, &one);
-  }
-
-  /* xu */
-  wr = (double *)MALLOC(mfft * sizeof(double));
-  wi = (double *)MALLOC(mfft * sizeof(double));
-  C2F(dset)(&mfft, &zero, wr, &one);
-  C2F(dset)(&mfft, &zero, wi, &one);
-  if (update) { /* if xu provided, update it */
-    getVarAddressFromPosition(_piKey, wpos + 1, &arg);
-    getMatrixOfDouble(_piKey, arg, &rows, &cols, &x_real);
-    nbx = rows * cols;
-    if (nbx > mfft) {
-      /* TODO: make error msg more accurate (2nd dim >= dim(arg)) */
-      Scierror(999, _("%s: Wrong size for input argument #%d: A %d-by-%d matrix expected.\n"), fname, 5, 1, 999);
-      return 1;
-    }
-    C2F(dcopy)(&nbx, x_real, &one, wr, &one);
-  }
-  else {
-    nbx = 0;
-  }
-
-  C2F(cmpse3)(&mfft, &length, (int *) &mode, x, y,
-             wr, wi, zr, zi,
-             &error, (int *) &update, &nbx);
-
-  if (error) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: Should be a power of 2"), fname, wpos);
-    return error;
-  }
-  /** @warning x built of data on the stack that's reaffected by matrix allocation
-     -> copied to keep it safe for lhs2 output */
-  C2F(dcopy)(&nbx, &(x[length-nbx]), &one, wr, &one);
-  allocComplexMatrixOfDouble(_piKey, Rhs + 1, 1, mfft, &rr, &ri);
-  C2F(dcopy)(&mfft, zr, &one, rr, &one);
-  C2F(dcopy)(&mfft, zi, &one, ri, &one);
-  LhsVar(1) = Rhs + 1;
-  if (Lhs == 2) {
-    allocMatrixOfDouble(_piKey, Rhs + 2, 1, nbx, &rr);
-    C2F(dcopy)(&nbx, wr, &one, rr, &one);
-    LhsVar(2) = Rhs + 2;
-  }
-  PutLhsVar();
-  FREE(wr);
-  FREE(wi);
-  return error;
-}
diff --git a/scilab/modules/signal_processing/sci_gateway/c/sci_delip.c b/scilab/modules/signal_processing/sci_gateway/c/sci_delip.c
deleted file mode 100644 (file)
index 5eb6072..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2009 - Digiteo - Vincent LIARD
- *
- * 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 "api_scilab.h"
-#include "gw_signal.h"
-#include "stack-c.h"
-#include "MALLOC.h"
-#include "Scierror.h"
-#include "localization.h"
-
-extern void C2F(delip)(int *length,
-                      double *output_real, double *output_imaginary,
-                      double *x, double *ck);
-
-int sci_delip(char *fname, int* _piKey)
-{
-  enum {real, complex} return_type;
-  int rows, cols, type, x_rows, x_cols, length, i;
-  double *argument, *output_real, *output_imaginary, *x, ck;
-  int *p;
-
-  CheckRhs(2,2);
-  CheckLhs(1,1);
-
-  /* arg1: x */
-  getVarAddressFromPosition(_piKey, 1, &p);
-       getVarType(_piKey, p, &type);
-  if (type != sci_matrix || isVarComplex(_piKey, p)) {
-    Scierror(999, _("%s: Wrong type for argument %d: Real matrix expected.\n"), fname, 1);
-    return 1;
-  }
-  // GetRhsVarMatrixDouble(1, &x_rows, &x_cols, &x);
-  getMatrixOfDouble(_piKey, p, &x_rows, &x_cols, &x);
-  length = x_cols * x_rows;
-  for (i = 0, return_type = real ; i < length ; i++) {
-    if (x[i] < 0) {
-      Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the interval [%s, %s].\n"), fname, 1, "0", "+INF");
-      return 1;
-    }
-    else if (x[i] > 1) {
-      return_type = complex;
-    }
-  }
-
-  /* arg2: ck */
-  getVarAddressFromPosition(_piKey, 2, &p);
-  // GetVarDimension(2, &rows, &cols);
-  getVarDimension(_piKey, p, &rows, &cols);
-  getVarType(_piKey, p, &type);
-
-  if (type != sci_matrix || rows != 1 || cols != 1 || isVarComplex(_piKey, p)) {
-    Scierror(999, _("%s: Wrong type for input argument #%d: Real scalar expected.\n"), fname, 2);
-    return 1;
-  }
-  // GetRhsVarMatrixDouble(2, &rows, &cols, &argument);
-  getMatrixOfDouble(_piKey, p, &rows, &cols, &argument);
-  ck = argument[0];
-  if (ck < -1 || ck > 1) {
-      Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the interval [%s, %s].\n"), fname, 2, "-1", "1");
-      return 1;
-  }
-
-  switch (return_type) {
-  case real:
-    // iAllocMatrixOfDouble(Rhs + 1, x_rows, x_cols, &output_real);
-    allocMatrixOfDouble(_piKey, Rhs + 1, x_rows, x_cols, &output_real);
-    createMatrixOfDouble(_piKey, Rhs + 1, x_rows, x_cols, output_real);
-    /* allocate a useless return buffer to securize delip's call */
-    output_imaginary = (double *)MALLOC(length * sizeof(double));
-    if (output_imaginary == NULL) {
-      Scierror(999, _("%s : Memory allocation error.\n"), fname);
-      return 1;
-    }
-    break;
-  case complex:
-    // iAllocComplexMatrixOfDouble(Rhs + 1, x_rows, x_cols, &output_real, &output_imaginary);
-    allocComplexMatrixOfDouble(_piKey, Rhs + 1, x_rows, x_cols, &output_real, &output_imaginary);
-    createComplexMatrixOfDouble(_piKey, Rhs + 1, x_rows, x_cols, output_real, output_imaginary);
-    break;
-  }
-  C2F(delip)(&length, output_real, output_imaginary, x, &ck);
-  if (return_type == real) {
-    FREE(output_imaginary);
-    output_imaginary = NULL;
-  }
-  LhsVar(1) = Rhs + 1;
-  PutLhsVar();
-  return 0;
-}
diff --git a/scilab/modules/signal_processing/sci_gateway/c/sci_fft.c b/scilab/modules/signal_processing/sci_gateway/c/sci_fft.c
deleted file mode 100644 (file)
index ade01e0..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2009 - Digiteo - Vincent LIARD
- *
- * 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 "api_scilab.h"
-
-
-#include "gw_signal.h"
-#include "MALLOC.h"
-#include "stack-c.h"
-#include "Scierror.h"
-#include "localization.h"
-#include <math.h>
-
-extern void C2F(fft842)(int *inverse, int *signal_length,
-                       double *signal_real, double *signal_imaginary,
-                       int *error);
-extern void C2F(dfft2)(double *signal_real, double *signal_imaginary,
-                      int *nseg, int *n, int *nspn,
-                      int *inverse, int *error,
-                      int *buffer_data, int *buffer_size);
-
-int POW2_15 = 32768;
-
-int my_log2(int n);
-int my_pow2(int n);
-int is_pow2(int n);
-int maxfactor(int n);
-int fft_1dim(double *signal_real, double *signal_imaginary, int signal_length,
-            int inverse, int *buffer_data, int buffer_size);
-int fft_2dim(double *signal_real, double *signal_imaginary,
-            int signal_rows, int signal_cols,
-            int inverse, int *buffer_data, int buffer_size);
-int fft_ndim(double *signal_real, double *signal_imaginary, int signal_length,
-            int dimensions_length, int dimension_stride,
-            int inverse, int *buffer_data, int buffer_size);
-
-int sci_fft(char *fname,  int* _piKey)
-{
-  double
-    *signal_real, *signal_imaginary, /* input signal */
-    *frequencies_real, *frequencies_imaginary, /* freq domain output */
-    *argument;
-  int
-    inverse = -1, /* -1 for forward transform, 1 for inverse */
-    /* [4213] should likely hold an array */
-    dimensions_length = 0, /* length of each dimension */
-    /* [4213] should likely hold an array */
-    /* assert: dimension_stride(1) = product(dimensions_length(j),j=1..i-1) */
-    dimension_stride = 0, /* stride for one step along each dimension */
-    dimension_count = 0; /* number of dimensions */
-  int signal_rows = 0, signal_cols = 0, rows = 0, cols = 0;
-
-  int *buffer_data = NULL;
-  int signal_length = 0, error = 0, buffer_size = 0;
-  int one = 1;
-  int *p;
-
-  CheckRhs(1,4); /* but RHS=3 invalid too: checked afterwars */
-  /** @todo check RHS = 3 verified */
-  CheckLhs(1,1);
-
-  /* collecting and checking arguments */
-  switch (Rhs) {   /* no breaks to collect all arguments */
-  case 4:
-    // GetRhsVarMatrixDouble(4, &rows, &cols, &argument);
-    getVarAddressFromPosition(_piKey, 4, &p);
-    getMatrixOfDouble(_piKey, p, &rows, &cols, &argument);
-    dimension_stride = (int)argument[0];
-    // GetRhsVarMatrixDouble(3, &rows, &cols, &argument);
-    getVarAddressFromPosition(_piKey, 3, &p);
-    getMatrixOfDouble(_piKey, p, &rows, &cols, &argument);
-    dimensions_length = (int)argument[0];
-    dimension_count = 3; /* any value > 2 (used as a flag) */
-  case 2: /* FALLTHROUGH */
-    // GetRhsVarMatrixDouble(2, &rows, &cols, &argument);
-    getVarAddressFromPosition(_piKey, 2, &p);
-    getMatrixOfDouble(_piKey, p, &rows, &cols, &argument);
-    inverse = argument[0];
-    if (rows != 1 || cols != 1) {
-      Scierror(999, _("%s: Wrong size for input argument #%d: A scalar expected.\n"), fname, 2);
-      return 1;
-    }
-    if (inverse != 1 && inverse != -1) {
-      Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"), fname, 2, "-1 1");
-      return 1;
-    }
-  case 1: /* FALLTHROUGH */
-    // GetVarDimension(1, &signal_rows, &signal_cols);
-    getVarAddressFromPosition(_piKey, 1, &p);
-    getVarDimension(_piKey, p, &signal_rows, &signal_cols);
-    dimension_count = Max(dimension_count,
-                         (signal_rows == 1 || signal_cols == 1) ? 1 : 2);
-    signal_length = signal_rows * signal_cols;
-    if (signal_length <= 1) {
-      Scierror(999, _("%s: Wrong size for input argument #%d: A vector expected.\n"), fname, 1);
-      return 1;
-    }
-    // iAllocComplexMatrixOfDouble(Rhs + 1, signal_rows, signal_cols, &frequencies_real, &frequencies_imaginary);
-    allocComplexMatrixOfDouble(_piKey, Rhs + 1, signal_rows, signal_cols, &frequencies_real, &frequencies_imaginary);
-    createComplexMatrixOfDouble(_piKey, Rhs + 1, signal_rows, signal_cols, frequencies_real, frequencies_imaginary);
-    // if (iIsComplex(1)) {
-    if (isVarComplex(_piKey, p)) {
-      // GetRhsVarMatrixComplex(1, &signal_rows, &signal_cols, &signal_real, &signal_imaginary);
-      getComplexMatrixOfDouble(_piKey, p, &signal_rows, &signal_cols, &signal_real, &signal_imaginary);
-      C2F(dcopy)(&signal_length, signal_real,
-                               &one, frequencies_real, &one);
-      C2F(dcopy)(&signal_length, signal_imaginary,
-                               &one, frequencies_imaginary, &one);
-    }
-    else {
-      double zero = 0L;
-      // GetRhsVarMatrixDouble(1, &signal_rows, &signal_cols, &signal_real);
-      getMatrixOfDouble(_piKey, p, &signal_rows, &signal_cols, &signal_real);
-      C2F(dcopy)(&signal_length, signal_real,
-                               &one, frequencies_real, &one);
-      C2F(dset)(&signal_length, &zero, frequencies_imaginary, &one);
-    }
-    break;
-  default:
-    Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), fname, 1, 4);
-    return 1;
-  }
-
-  /* upper bound on the workspace required by dfft2 */
-  buffer_size = 8 * maxfactor(signal_length) + 24;
-  buffer_data = (int *)CALLOC(buffer_size, sizeof(int));
-  if (buffer_data == NULL) {
-    Scierror(999, _("%s : Memory allocation error.\n"), fname);
-    return 1;
-  }
-
-  /* how to compute depends on the dimension */
-  switch (dimension_count) {
-  case 1:
-    error = fft_1dim(frequencies_real, frequencies_imaginary,
-                    signal_length, inverse, buffer_data, buffer_size);
-    break;
-  case 2:
-    error = fft_2dim(frequencies_real, frequencies_imaginary,
-                    signal_rows, signal_cols, inverse,
-                    buffer_data, buffer_size);
-    if (error == 1) {
-      Scierror(999, _("%s : Memory allocation error.\n"), fname);
-    }
-    break;
-  default:
-    error = fft_ndim(frequencies_real, frequencies_imaginary,
-                    signal_length, dimensions_length, dimension_stride,
-                    inverse, buffer_data, buffer_size);
-    break;
-  }
-
-  /* preparing the return value */
-  LhsVar(1) = Rhs + 1;
-  PutLhsVar();
-  FREE(buffer_data);
-  buffer_data = NULL;
-  return 0;
-}
-
-int fft_1dim(double *signal_real, double *signal_imaginary,
-            int signal_length, int inverse,
-            int *buffer_data, int buffer_size) {
-  int error = 0, one = 1;
-  if (is_pow2(signal_length) && signal_length < POW2_15) {
-    C2F(fft842)(&inverse, &signal_length,
-               signal_real, signal_imaginary, &error);
-  }
-  else {
-    C2F(dfft2)(signal_real, signal_imaginary,
-              &one, &signal_length, &one,
-              &inverse, &error,
-              buffer_data, &buffer_size);
-  }
-  return error;
-}
-
-int fft_2dim(double *signal_real, double *signal_imaginary,
-                   int signal_rows, int signal_cols,
-                   int inverse,
-                   int *buffer_data, int buffer_size) {
-  int error = 0, i, one = 1;
-  if (is_pow2(signal_rows) && signal_rows < POW2_15) {
-    for (i = 0 ; i < signal_cols ; i++) {
-      C2F(fft842)(&inverse, &signal_rows,
-                 &(signal_real[signal_rows * i]),
-                 &(signal_imaginary[signal_rows * i]), &error);
-    }
-  }
-  else {
-    C2F(dfft2)(signal_real, signal_imaginary,
-              &signal_cols, &signal_rows, &one,
-              &inverse, &error, buffer_data, &buffer_size);
-  }
-  if (is_pow2(signal_cols) && signal_cols < POW2_15) {
-    double *temp_real, *temp_imaginary;
-    temp_real = (double *)MALLOC(signal_cols * sizeof(double));
-    temp_imaginary = (double *)MALLOC(signal_cols * sizeof(double));
-    if (temp_real == NULL || temp_imaginary == NULL) {
-      return 1;
-    }
-    for (i = 0 ; i < signal_rows ; i++) {
-      C2F(dcopy)(&signal_cols, &(signal_real[i]),
-                &signal_rows, temp_real, &one);
-      C2F(dcopy)(&signal_cols, &(signal_imaginary[i]),
-                &signal_rows, temp_imaginary, &one);
-      C2F(fft842)(&inverse, &signal_cols,
-                 temp_real, temp_imaginary, &error);
-      C2F(dcopy)(&signal_cols, temp_real, &one,
-                &(signal_real[i]), &signal_rows);
-      C2F(dcopy)(&signal_cols, temp_imaginary, &one,
-                &(signal_imaginary[i]), &signal_rows);
-    }
-    FREE(temp_imaginary);
-    temp_imaginary = NULL;
-    free(temp_real);
-    temp_real = NULL;
-  }
-  else { /* erroneous implementation suspected */
-    C2F(dfft2)(signal_real, signal_imaginary,
-              &one, &signal_cols, &signal_rows,
-              &inverse, &error, buffer_data, &buffer_size);
-  }
-  return error;
-}
-
-int fft_ndim(double *signal_real, double *signal_imaginary,
-            int signal_length, int dimensions_length, int dimension_stride,
-            int inverse, int *buffer_data, int buffer_size) {
-  /* translated litterally from Fortran... but... wtf ?! */
-  int error = 0;
-  int nseg = signal_length / dimensions_length / dimension_stride;
-  C2F(dfft2)(signal_real, signal_imaginary, &nseg,
-            &dimensions_length, &dimension_stride, &inverse, &error,
-            buffer_data, &buffer_size);
-  return error;
-}
-
-/* maximum factor of the prime decomposition of n
-   - extracted and translated from dfftbi.f
-   - pityfully needed to allocate the appropriate mem
-   - translated litterally to make sure the result is the same
-   TODO: remove once allocation moved to algorithm
- */
-int maxfactor(int n) {
-  int nfac[15];
-  int m = 0, j = 0, jj = 0, k = 0, kt = 0, max = 0;
-
-  for (k = abs(n) ; k % 16 == 0 ; k /= 16) {
-    m++;
-    nfac[m-1] = 4;
-  }
-  for (j = 3, jj = 9 ; jj <= k ; j += 2, jj = j*j) {
-    if (k % jj != 0) continue;
-    m++;
-    nfac[m-1] = j;
-    k /= jj;
-  }
-  if (k <= 4) {
-    kt = m;
-    nfac[m] = k;
-    if (k != 1)
-      m++;
-  }
-  else {
-    if (k % 4 == 0) {
-      m++;
-      nfac[m-1] = 2;
-      k /= 4;
-    }
-    kt = m;
-    for (j = 2 ; j <= k ; j = ((j + 1) / 2) * 2 + 1) {
-      if (k % j != 0)
-       continue;
-      m++;
-      nfac[m-1] = j;
-      k /= j;
-    }
-  }
-  if (kt != 0) {
-    for (j = kt ; j > 0 ; j--) {
-      m++;
-      nfac[m-1] = nfac[j-1];
-    }
-  }
-  /* get nfac maximum */
-  for (j = 0, max = nfac[0]; j < m ; j++) {
-    max = (nfac[j] > max) ? nfac[j] : max;
-  }
-  return max;
-}
-
-/* because log2 is only C99... */
-int my_log2(int n) {
-  return (int)(log(n)/log(2));
-}
-
-int my_pow2(int n) {
-  return 1 << n;
-}
-
-int is_pow2(int n) {
-  return my_pow2(my_log2(n)) == n;
-}
index 944c654..38779b5 100644 (file)
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  */
 
-#include "api_scilab.h"
 #include "MALLOC.h"
 #include "gw_signal.h"
 #include "stack-c.h"
 #include "Scierror.h"
 #include "localization.h"
 
+#include "api_scilab.h"
+#include "api_oldstack.h"
+
 extern void C2F(remez)(int *ngrid, int *nc, int *iext,
                       double *ad, double *x, double *y,
                       float *des, float *grid, float *wt,
diff --git a/scilab/modules/signal_processing/sci_gateway/c/sci_rpem.c b/scilab/modules/signal_processing/sci_gateway/c/sci_rpem.c
deleted file mode 100644 (file)
index 030eff2..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2009 - Digiteo - Vincent LIARD
- *
- * 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 "api_scilab.h"
-#include "gw_signal.h"
-#include "MALLOC.h"
-#include "stack-c.h"
-#include "Scierror.h"
-#include "localization.h"
-
-extern void C2F(rpem)(double theta[], double p[],
-                     int *order,
-                     double *u, double *y, double *lambda, double *k, double *c,
-                     int *istab2,
-                     double *v, double *eps, double *eps1,
-                     int *dimension,
-                     double phi[], double psi[], double tstab[],
-                     double work[], double f[], double g[], double l[]);
-
-int sci_rpem(char *fname, int* _piKey)
-{
-  double *data, *theta, *p, *l, *phi, *psi, *u, *y, *tstab, *work, *f, *g;
-  double v, eps, eps1;
-  double lambda = 0.950l, alpha = 0.990l, beta = 0.01l, kappa = 0.000l, mu = 0.980l, nu = 0.020l, c = 1000.0l;
-  int rows, cols, type, order, dimension, istab2, u_length, i;
-  int *arg, *it, *res;
-
-
-  /*** arguments capture ***/
-
-  CheckRhs(3,6);
-  CheckLhs(1,2);
-
-  /* arg1: w0 = list(theta, p, l, phi, psi) */
-  getVarAddressFromPosition(_piKey, 1, &arg);
-  getListItemNumber(_piKey, arg, &rows);
-       getVarType(_piKey, arg, &type);
-  if (type != sci_list || rows != 5) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: %d-element list expected.\n"), fname, 1, 5);
-    return 1;
-  }
-
-  /** @todo type of each matrix in w0 should be checked to real
-   sci_matrix (better placed in matrix retrieval functions) */
-  /** @todo error messages should be more accurate */
-
-  /* theta: 3n real ranged row vector */
-  getListItemAddress(_piKey, arg, 1, &it);
-  getMatrixOfDouble(_piKey, it, &rows, &cols, &theta);
-  if (rows != 1) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: A row vector expected.\n"), fname, 1);
-    return 1;
-  }
-  if (cols % 3 != 0) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: Size must be multiple of %d.\n"), fname, 1, 3);
-    return 1;
-  }
-  dimension = cols;
-  order = dimension / 3;
-
-  /* p: 3n x 3n real ranged matrix */
-  getListItemAddress(_piKey, arg, 2, &it);
-  getMatrixOfDouble(_piKey, it, &rows, &cols, &p);
-  if (rows != dimension || cols != dimension) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: A square matrix expected.\n"), fname, 1, 1);
-    return 1;
-  }
-  /* l: 3n real ranged row vector */
-  getListItemAddress(_piKey, arg, 3, &it);
-  getMatrixOfDouble(_piKey, it, &rows, &cols, &l);
-  if (rows != 1 || cols != dimension) {
-    Scierror(999, _("%s: Incompatible input arguments #%d and #%d': Same sizes expected.\n"), fname, 1, 1);
-    return 1;
-  }
-  /* phi: 3n real ranged row vector */
-  getListItemAddress(_piKey, arg, 4, &it);
-  getMatrixOfDouble(_piKey, it, &rows, &cols, &phi);
-  if (rows != 1 || cols != dimension) {
-    Scierror(999, _("%s: Incompatible input arguments #%d and #%d': Same sizes expected.\n"), fname, 1, 1);
-    return 1;
-  }
-  /* psi: 3n real ranged row vector */
-  getListItemAddress(_piKey, arg, 5, &it);
-  getMatrixOfDouble(_piKey, it, &rows, &cols, &psi);
-  if (rows != 1 || cols != dimension) {
-    Scierror(999, _("%s: Incompatible input arguments #%d and #%d': Same sizes expected.\n"), fname, 1, 1);
-    return 1;
-  }
-
-  /* arg2: u0: real ranged row vector */
-  getVarAddressFromPosition(_piKey, 2, &arg);
-  getMatrixOfDouble(_piKey, arg, &rows, &cols, &u);
-  getVarType(_piKey, arg, &type);
-  if((type != sci_matrix) || (rows != 1)) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: A row vector expected.\n"), fname, 2);
-    return 1;
-  }
-  u_length = cols;
-
-  /* arg3: y0: real ranged row vector of same length as u0 */
-  getVarAddressFromPosition(_piKey, 3, &arg);
-  getMatrixOfDouble(_piKey, arg, &rows, &cols, &y);
-  getVarType(_piKey, arg, &type);
-  if ((type != sci_matrix) || (rows != 1) || (cols != u_length)) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: A row vector expected.\n"), fname, 3);
-    Scierror(999, _("%s: Incompatible input arguments #%d and #%d: Same column dimensions expected.\n"), fname, 2, 3);
-    return 1;
-  }
-
-  /* optional arguments */
-  switch (Rhs) {
-  case 6: /* c */
-    getVarAddressFromPosition(_piKey, 6, &arg);
-    getMatrixOfDouble(_piKey, arg, &rows, &cols, &data);
-    getVarType(_piKey,  arg, &type);
-    if (type != sci_matrix || rows != 1 || cols != 1) {
-      Scierror(999, _("%s: Wrong size for input argument #%d: A scalar expected.\n"), fname, 6);
-      return 1;
-    }
-    c = *data;
-  case 5: /* [kappa, mu, nu] */
-    getVarAddressFromPosition(_piKey, 5, &arg);
-    getMatrixOfDouble(_piKey, arg, &rows, &cols, &data);
-    getVarType(_piKey,  arg, &type);
-    if (type != sci_matrix || rows != 1 || cols != 3) {
-      Scierror(999, _("%s: Wrong size for input argument #%d: A %d-by-%d matrix expected.\n"), fname, 5, 1, 3);
-      return 1;
-    }
-    kappa = data[0];
-    mu = data[1];
-    nu = data[2];
-  case 4: /* [lambda, alpha, beta] */
-    getVarAddressFromPosition(_piKey, 4, &arg);
-    getMatrixOfDouble(_piKey, arg, &rows, &cols, &data);
-    getVarType(_piKey,  arg, &type);
-    if (type != sci_matrix || rows != 1 || cols != 3) {
-      Scierror(999, _("%s: Wrong size for input argument #%d: A %d-by-%d matrix expected.\n"), fname, 4, 1, 3);
-      return 1;
-    }
-               lambda = data[0];
-               alpha = data[1];
-               beta = data[2];
-  }
-
-  /*** algorithm call ***/
-
-  /* references provided to justify allocation with code relying on it */
-  f = (double *) MALLOC((dimension) * sizeof(double));         /* rpem.f l.168 */
-  g = (double *) MALLOC((dimension) * sizeof(double));                 /* rpem.f l.169  */
-  tstab = (double *) MALLOC((order + 1) * sizeof(double));     /* rpem.f l.105 */
-  work = (double *) MALLOC((2 * order + 2) * sizeof(double));  /* nstabl.f */
-  /* (tip: bound variables to determine required memory: nk1 <= ordre + 1) */
-
-  for (i = 1 ; i < u_length ; ++i) {
-    C2F(rpem)(theta, p, &order, &(u[i-1]), &(y[i]), &lambda, &kappa, &c,
-             &istab2, &v, &eps, &eps1, //output
-             &dimension, phi, psi,
-             tstab,work, //output
-             f, g, l);
-    lambda = alpha * lambda + beta;
-    kappa = mu * kappa + nu;
-  }
-
-  FREE(work);
-  FREE(tstab);
-  FREE(g);
-  FREE(f);
-
-  /*** output formatting ***/
-
-  createList(_piKey, Rhs + 1, 5, &res);
-  createMatrixOfDoubleInList(_piKey, Rhs + 1, res, 1, 1, dimension, theta);
-  createMatrixOfDoubleInList(_piKey, Rhs + 1, res, 2, dimension, dimension, p);
-  createMatrixOfDoubleInList(_piKey, Rhs + 1, res, 3, 1, dimension, l);
-  createMatrixOfDoubleInList(_piKey, Rhs + 1, res, 4, 1, dimension, phi);
-  createMatrixOfDoubleInList(_piKey, Rhs + 1, res, 5, 1, dimension, psi);
-  LhsVar(1) = Rhs + 1;
-  if (Lhs == 2) {
-    //allocMatrixOfDouble(_piKey, Rhs + 2, 1, 1, &data);
-    createMatrixOfDouble(_piKey, Rhs + 2, 1, 1, &v);
-    LhsVar(2) = Rhs + 2;
-  }
-  PutLhsVar();
-  return 0;
-}
diff --git a/scilab/modules/signal_processing/sci_gateway/c/sci_syredi.c b/scilab/modules/signal_processing/sci_gateway/c/sci_syredi.c
deleted file mode 100644 (file)
index ef8aab8..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2009 - Digiteo - Vincent LIARD
- *
- * 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 "api_scilab.h"
-#include "gw_signal.h"
-#include "MALLOC.h"
-#include "stack-c.h"
-#include "Scierror.h"
-#include "localization.h"
-#include <math.h>
-
-extern void C2F(syredi)(int *maxdeg, int *ityp, int *iapro,
-                       double *om, double *adelp, double *adels,
-                       /* outputs */
-                       int *deg_count, int *zeros_count,
-                       double *fact,
-                       double *b2, double *b1, double *b0,
-                       double *c1, double *c0,
-                       double *zzr, double *zzi,
-                       double *zpr, double *zpi,
-                       int *ierr,
-                       /* working buffers */
-                       double *spr, double *spi,
-                       double *pren, double *pimn,
-                       double *zm, double *sm, double *rom,
-                       /* v-- doutful types but whatever... */
-                       double *nzero, double *nze);
-
-enum filter_type {
-  low_pass = 1,
-  high_pass = 2,
-  band_pass = 3,
-  stop_band = 4};
-
-enum design_type {
-  butterworth = 1,
-  elliptic = 2,
-  chebytchev1 = 3,
-  chebytchev2 = 4};
-
-int syredi_buffered(enum filter_type filter, enum design_type design,
-                   double cutoff_frequencies[4],
-                   double ripple_passband, double ripple_stopband,
-                   /* outputs */
-                   int *deg_count, int *zeros_count, double *fact,
-                   double b2[], double b1[], double b0[],
-                   double c1[], double c0[],
-                   double zzr[], double zzi[],
-                   double zpr[], double zpi[]);
-
-void questionable_copy(int count,
-                      double input_real[], double input_imaginary[],
-                      double output_real[], double output_imaginary[]);
-
-int coherent_cutoffs(double cutoffs[], enum filter_type kind);
-
-int is_sorted_ascending(double values[], int length);
-
-double maximum(double values[], int count);
-double minimum(double values[], int count);
-
-int sci_syredi(char *fname, int* _piKey)
-{
-  enum filter_type filter;
-  enum design_type design;
-  int rows, cols, one = 1;
-  double *argument = NULL, *cutoff_frequencies = NULL;
-  double ripple_passband, ripple_stopband;
-
-  /* output variables */
-  int deg_count, zeros_count, error;
-  double *fact, *b0, *b1, *b2, *c0, *c1;
-  double
-    *zeros_real = NULL, *zeros_imaginary = NULL,
-    *poles_real = NULL, *poles_imaginary = NULL;
-
-  /* output buffers used for computation, ultimately copied to output variables */
-  #define OUTPUT_BUFFERS_COUNT 9
-  int output_buffers_count = OUTPUT_BUFFERS_COUNT;
-  int output_buffers_sizes[OUTPUT_BUFFERS_COUNT] =
-    {32, 32, 32, 32, 32, 64, 64, 64, 64};
-  double *output_buffers[OUTPUT_BUFFERS_COUNT];
-  int output_cursor;
-  #undef OUTPUT_BUFFERS_COUNT
-
-  int *p;
-
-  CheckRhs(5,5);
-  CheckLhs(8,8);
-
-  /* arg1: filter kind */
-  // GetRhsVarMatrixDouble(1, &rows, &cols, &argument);
-  getVarAddressFromPosition(_piKey, 1, &p);
-  getMatrixOfDouble(_piKey, p, &rows, &cols, &argument);
-  filter = (int)argument[0];
-
-  /* arg2: approximation kind */
-  // GetRhsVarMatrixDouble(2, &rows, &cols, &argument);
-  getVarAddressFromPosition(_piKey, 2, &p);
-  getMatrixOfDouble(_piKey, p, &rows, &cols, &argument);
-  design = (int)argument[0];
-
-  /* arg3: cutoff frequencies */
-  // GetRhsVarMatrixDouble(3, &rows, &cols, &cutoff_frequencies);
-  getVarAddressFromPosition(_piKey, 3, &p);
-  getMatrixOfDouble(_piKey, p, &rows, &cols, &cutoff_frequencies);
-  if (rows != 1 || cols != 4) {
-    Scierror(999, _("%s: Wrong size for input argument #%d: A %d-by-%d array expected.\n"), fname, 3, 1, 4);
-    return 1;
-  }
-  if (minimum(cutoff_frequencies, 4) < 0 || maximum(cutoff_frequencies, 4) > M_PI) {
-    Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the interval [%s, %s].\n"), fname, 4, "0", "%pi");
-    return 1;
-  }
-  if (((filter == low_pass || filter == high_pass)
-       && !is_sorted_ascending(cutoff_frequencies, 2)) ||
-      ((filter == band_pass || filter == stop_band)
-       && !is_sorted_ascending(cutoff_frequencies, 4))) {
-    Scierror(999, _("%s: Wrong values for input argument #%d: Elements must be in increasing order.\n"), fname, 3);
-    return 1;
-  }
-
-  /* arg4: passband's ripple */
-  // GetRhsVarMatrixDouble(4, &rows, &cols, &argument);
-  getVarAddressFromPosition(_piKey, 4, &p);
-  getMatrixOfDouble(_piKey, p, &rows, &cols, &argument);
-  ripple_passband = argument[0];
-  if (ripple_passband <= 0 || ripple_passband >= 1) {
-    Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the interval [%s, %s].\n"), fname, 4, "0", "1");
-    return 1;
-  }
-
-  /* arg5: stopband's ripple */
-  // GetRhsVarMatrixDouble(5, &rows, &cols, &argument);
-  getVarAddressFromPosition(_piKey, 5, &p);
-  getMatrixOfDouble(_piKey, p, &rows, &cols, &argument);
-  ripple_stopband = argument[0];
-  if (ripple_stopband <= 0 || ripple_stopband >= 1) {
-    Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the interval [%s, %s].\n"), fname, 5, "0", "1");
-    return 1;
-  }
-
-  for (output_cursor = 0 ; output_cursor < output_buffers_count ; ++output_cursor) {
-    output_buffers[output_cursor] = (double *)MALLOC(output_buffers_sizes[output_cursor] * sizeof(double));
-    if (output_buffers[output_cursor] == NULL) {
-      Scierror(999, _("%s : Memory allocation error.\n"), fname);
-      // TODO: free buffers (elegantly, possibly use an abstraction for this)
-      return 1;
-    }
-  }
-
-  // iAllocMatrixOfDouble(Rhs + 1, 1, 1, &fact);
-  allocMatrixOfDouble(_piKey, Rhs + 1, 1, 1, &fact);
-  createMatrixOfDouble(_piKey, Rhs + 1, 1, 1, fact);
-
-  error = syredi_buffered(/* inputs */
-                         filter, design,
-                         cutoff_frequencies, ripple_passband, ripple_stopband,
-                         /* outputs */
-                         &zeros_count, &deg_count, fact,
-                         output_buffers[0], output_buffers[1],
-                         output_buffers[2], output_buffers[3],
-                         output_buffers[4], output_buffers[5],
-                         output_buffers[6], output_buffers[7],
-                         output_buffers[8]);
-  if (error) {
-    Scierror(999, _("%s : Memory allocation error.\n"), fname);
-    return 1;
-  }
-
-  /* ret1: fact */
-  LhsVar(1) = Rhs + 1;
-
-  /* ret2: b2 */
-  // iAllocMatrixOfDouble(Rhs + 2, 1, deg_count, &b2);
-  allocMatrixOfDouble(_piKey, Rhs + 2, 1, deg_count, &b2);
-  //createMatrixOfDouble(Rhs + 2, 1, deg_count, b2);
-  C2F(dcopy)(&deg_count, output_buffers[0], &one, b2, &one);
-  LhsVar(2) = Rhs + 2;
-
-  /* ret3: b1 */
-  // iAllocMatrixOfDouble(Rhs + 3, 1, deg_count, &b1);
-  allocMatrixOfDouble(_piKey, Rhs + 3, 1, deg_count, &b1);
-  //createMatrixOfDouble(Rhs + 3, 1, deg_count, b1);
-  C2F(dcopy)(&deg_count, output_buffers[1], &one, b1, &one);
-  LhsVar(3) = Rhs + 3;
-
-  /* ret4: b0 */
-  // iAllocMatrixOfDouble(Rhs + 4, 1, deg_count, &b0);
-  allocMatrixOfDouble(_piKey, Rhs + 4, 1, deg_count, &b0);
-  //createMatrixOfDouble(Rhs + 4, 1, deg_count, b0);
-  C2F(dcopy)(&deg_count, output_buffers[2], &one, b0, &one);
-  LhsVar(4) = Rhs + 4;
-
-  /* ret5: c1 */
-  // iAllocMatrixOfDouble(Rhs + 5, 1, deg_count, &c1);
-  allocMatrixOfDouble(_piKey, Rhs + 5, 1, deg_count, &c1);
-  //createMatrixOfDouble(Rhs + 5, 1, deg_count, c1);
-  C2F(dcopy)(&deg_count, output_buffers[3], &one, c1, &one);
-  LhsVar(5) = Rhs + 5;
-
-  /* ret6: c0 */
-  // iAllocMatrixOfDouble(Rhs + 6, 1, deg_count, &c0);
-  allocMatrixOfDouble(_piKey, Rhs + 6, 1, deg_count, &c0);
-  //createMatrixOfDouble(Rhs + 6, 1, deg_count, c0);
-  C2F(dcopy)(&deg_count, output_buffers[4], &one, c0, &one);
-  LhsVar(6) = Rhs + 6;
-
-  /* ret7: zeros */
-  // iAllocComplexMatrixOfDouble(Rhs + 7, 1, zeros_count, &zeros_real, &zeros_imaginary);
-  allocComplexMatrixOfDouble(_piKey, Rhs + 7, 1, zeros_count, &zeros_real, &zeros_imaginary);
-  //createComplexMatrixOfDouble(Rhs + 7, 1, zeros_count, zeros_real, zeros_imaginary);
-  questionable_copy(zeros_count, output_buffers[5], output_buffers[6],
-                   zeros_real, zeros_imaginary);
-  LhsVar(7) = Rhs + 7;
-
-  /* ret8: poles */
-  // iAllocComplexMatrixOfDouble(Rhs + 8, 1, zeros_count, &poles_real, &poles_imaginary);
-  allocComplexMatrixOfDouble(_piKey, Rhs + 8, 1, zeros_count, &poles_real, &poles_imaginary);
-  //createComplexMatrixOfDouble(Rhs + 8, 1, zeros_count, poles_real, poles_imaginary);
-  questionable_copy(zeros_count, output_buffers[7], output_buffers[8], poles_real, poles_imaginary);
-  LhsVar(8) = Rhs + 8;
-
-  for (output_cursor-- ; output_cursor >= 0 ; output_cursor--) {
-    FREE(output_buffers[output_cursor]);
-    output_buffers[output_cursor] = NULL;
-  }
-
-  PutLhsVar();
-  return error;
-}
-
-int syredi_buffered(/* inputs */
-                   enum filter_type filter, enum design_type design,
-                   double cutoff_frequencies[4], double ripple_passband, double ripple_stopband,
-                   /* outputs */
-                   int *zeros_count, int *deg_count, double *fact,
-                   double b2[], double b1[], double b0[],
-                   double c1[], double c0[],
-                   double zzr[], double zzi[],
-                   double zpr[], double zpi[])
-{
-  #define BUFFERS_COUNT 9
-  const int buffers_count = BUFFERS_COUNT;
-  int buffers_sizes[BUFFERS_COUNT] = {64, 64, 64, 64, 256, 256, 16, 64, 64};
-  double *buffers[BUFFERS_COUNT];
-  #undef BUFFERS_COUNT
-  int maxdeg = 64, error = 1, i;
-
-  for (i = 0 ; i < buffers_count ; ++i) {
-    buffers[i] = (double *)MALLOC(buffers_sizes[i] * sizeof(double));
-    if (buffers[i] == NULL) {
-      break;
-    }
-  }
-  if (i == buffers_count) {
-    C2F(syredi)(/* inputs */
-               &maxdeg, (int *) &filter, (int *) &design,
-               cutoff_frequencies, &ripple_passband, &ripple_stopband,
-               /* outputs */
-               zeros_count, deg_count, fact,
-               b2, b1, b0, c1, c0,
-               zzr, zzi, zpr, zpi,
-               &error,
-               /* buffers */
-               buffers[0], buffers[1], buffers[2], buffers[3],
-               buffers[4], buffers[5],
-               buffers[6],
-               buffers[7], buffers[8]);
-  }
-  for (i-- ; i >= 0 ; i--) {
-    FREE(buffers[i]);
-    buffers[i] = NULL;
-  }
-  return error;
-}
-
-/* copies input to output adding conjugates */
-/* questionable until the reason of input data loss is clarified */
-/* translated from sci_syredi.f */
-void questionable_copy(int length,
-                      double input_real[], double input_imaginary[],
-                      double output_real[], double output_imaginary[])
-{
-  int i, j;
-  for (i = 0, j = 0 ; j < length ; ++i, ++j) {
-    output_real[j] = input_real[i];
-    output_imaginary[j] = input_imaginary[i];
-    /* doubles compared with == as in fortran's source */
-    if (input_imaginary[i] != 0L) {
-      ++j;
-      output_real[j] = input_real[i];
-      output_imaginary[j] = - input_imaginary[i];
-    }
-  }
-}
-
-/* checks whether the values array (with length elements) is ascendingly sorted */
-int is_sorted_ascending(double values[], int length) {
-  int i;
-  for (i = 0 ; i < length - 1 ; ++i) {
-    if (values[i] > values[i + 1]) {
-      return 0;
-    }
-  }
-  return 1;
-}
-
-/* returns the maximum of the values array (with length elements) */
-double maximum(double values[], int length) {
-  int i;
-  double max;
-  for (i = 0, max = values[0] ; i < length ; ++i) {
-    max = Max(values[i], max);
-  }
-  return max;
-}
-
-/* returns the minimum of the values array (with length elements) */
-double minimum(double values[], int length) {
-  int i;
-  double min;
-  for (i = 0, min = values[0] ; i < length ; ++i) {
-    min = Min(values[i], min);
-  }
-  return min;
-}
diff --git a/scilab/modules/signal_processing/sci_gateway/cpp/sci_corr.cpp b/scilab/modules/signal_processing/sci_gateway/cpp/sci_corr.cpp
new file mode 100644 (file)
index 0000000..cff64bc
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2011 - DIGITEO - Antoine ELIAS
+*
+* 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 "signal_gw.hxx"
+#include "double.hxx"
+#include "string.hxx"
+#include "function.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+
+//fortran prototypes
+extern void C2F(tscccf)(double *x, double *y, int *length, double *cxy, double *xymean, int *lag, int *error);
+
+}
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_corr(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    //check input parameters
+    if(in.size() < 2 || in.size() > 5)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"corr", 2, 5);
+        return types::Function::Error;
+    }
+
+    //call format
+    if(in[0]->isString())
+    {
+        sciprintW(_W("%ls: Need to plug external call"), L"corr");
+        return types::Function::Error;
+
+        types::String* pS = in[0]->getAs<types::String>();
+        if(pS->getSize() == 1 && pS->get(0)[0] == L'f')
+        {//[cov,mean]=corr('fft',xmacro,[ymacro],n,sect)
+            int iErr                    = 0;
+            int iSect                   = 0;
+            int iTotalSize              = 0;
+            int iSize                   = 0;
+            int iMode                   = 0;
+            types::Callable* pXFunction = NULL;
+            types::Callable* pYFunction = NULL;
+
+            //check input parameters
+            if(in.size() < 4 || in.size() > 5)
+            {
+                ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"corr", 4, 5);
+                return types::Function::Error;
+            }
+
+            //get parameter sect
+            int iPos = (int)(in.size() - 1);
+            if(in[iPos]->isDouble() == false || in[iPos]->getAs<types::Double>()->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A scalar expected.\n"), L"corr", iPos + 1);
+                return types::Function::Error;
+            }
+
+            iSect = (int)in[iPos]->getAs<types::Double>()->get(0);
+
+            //get parameter n
+            iPos--;
+            if(in[iPos]->isDouble() == false || in[iPos]->getAs<types::Double>()->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A scalar expected.\n"), L"corr", iPos + 1);
+                return types::Function::Error;
+            }
+
+            iTotalSize = (int)in[iPos]->getAs<types::Double>()->get(0);
+
+            //get xmacro
+            if(in[1]->isCallable() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A function expected.\n"), L"corr", 2);
+                return types::Function::Error;
+            }
+
+            pXFunction = in[1]->getAs<types::Callable>();
+            iMode = 2;
+
+            if(in.size() == 5)
+            {
+                //get ymacro
+                if(in[2]->isCallable() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A function expected.\n"), L"corr", 3);
+                    return types::Function::Error;
+                }
+
+                pYFunction = in[2]->getAs<types::Callable>();
+                iMode = 3;
+            }
+
+        }
+        else if(pS->getSize() == 1 && pS->get(0)[0] == L'u')
+        {//update
+        }
+        else
+        {//error
+            ScierrorW(999, _W("%ls: Wrong value for input argument #%d: Must be in the set {%ls}.\n"), L"corr", 1, L"'fft', 'update'");
+            return types::Function::Error;
+        }
+    }
+    else
+    {//usual case [cov,mean]=corr(x,[y],nlags)
+        int iErr                        = 0;
+        int iCorrelation                = 0;
+        types::Double* pDblX            = NULL;
+        types::Double* pDblY            = NULL;
+        types::Double* pDblCorrelation  = NULL;
+        types::Double* pDblMean         = NULL;
+        int iSize                       = 0;
+        double pdblMean[2];
+
+
+        //check input parameters
+        if(in.size() < 2 || in.size() > 3)
+        {
+            ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"corr", 2, 3);
+            return types::Function::Error;
+        }
+
+        //get last parameter nlags
+        int iPos = (int)(in.size() - 1);
+        if(in[iPos]->isDouble() == false || in[iPos]->getAs<types::Double>()->isScalar() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A scalar expected.\n"), L"corr", iPos + 1);
+            return types::Function::Error;
+        }
+
+        iCorrelation = (int)in[iPos]->getAs<types::Double>()->get(0);
+        pDblCorrelation = new types::Double(1, iCorrelation);
+
+        if(in.size() == 3)
+        {
+            if(in[1]->isDouble() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Matrix expected.\n"), L"corr" ,2);
+                return types::Function::Error;
+            }
+
+            pDblY = in[1]->getAs<types::Double>();
+
+            if(in[0]->isDouble() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Matrix expected.\n"), L"corr" ,1);
+                return types::Function::Error;
+            }
+
+            pDblX = in[0]->getAs<types::Double>();
+
+            if(pDblX->getSize() != pDblY->getSize())
+            {
+                ScierrorW(60, _W("%ls: Wrong size for argument: Incompatible dimensions.\n"), L"corr");
+                return types::Function::Error;
+            }
+        }
+        else
+        {
+            if(in[0]->isDouble() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Matrix expected.\n"), L"corr" ,1);
+                return types::Function::Error;
+            }
+
+            pDblX = in[0]->getAs<types::Double>();
+            pDblY = pDblX;
+        }
+
+        iSize = pDblX->getSize();
+
+        C2F(tscccf)(pDblX->get(), pDblY->get(), &iSize, pDblCorrelation->get(), pdblMean, &iCorrelation, &iErr);
+        if(iErr == -1)
+        {
+            ScierrorW(999, _W("%ls: Too many coefficients are required.\n"), L"corr");
+            return types::Function::Error;
+        }
+
+        out.push_back(pDblCorrelation);
+
+        if(_iRetCount == 2)
+        {
+            if(in.size() == 3)
+            {
+                pDblMean = new types::Double(1, 2);
+            }
+            else
+            {
+                pDblMean = new types::Double(1, 1);
+            }
+
+            pDblMean->set(pdblMean);
+            out.push_back(pDblMean);
+        }
+    }
+    return types::Function::OK;
+}
\ No newline at end of file
diff --git a/scilab/modules/signal_processing/sci_gateway/cpp/sci_delip.cpp b/scilab/modules/signal_processing/sci_gateway/cpp/sci_delip.cpp
new file mode 100644 (file)
index 0000000..e9da909
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2011 - DIGITEO - Antoine ELIAS
+*
+* 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 "signal_gw.hxx"
+#include "double.hxx"
+#include "function.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+
+extern void C2F(delip)(int *length,
+                      double *output_real, double *output_imaginary,
+                      double *x, double *ck);
+}
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_delip(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    bool bBecomeComplex = false;
+    //check input parameters
+    if(in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"delip", 2);
+        return types::Function::Error;
+    }
+
+    //check first input parameter : x
+    if(in[0]->isDouble() == false || in[0]->getAs<types::Double>()->isComplex() == true)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for argument %d: Real matrix expected.\n"), L"delip", 1);
+        return types::Function::Error;
+    }
+
+    types::Double* pIn1 = in[0]->getAs<types::Double>();
+    double* pdblIn1 = pIn1->get();
+    int iSize = pIn1->getSize();
+
+    for(int i = 0 ; i < iSize ; i++)
+    {
+        if(pdblIn1[i] < 0)
+        {
+            ScierrorW(999, _W("%ls: Wrong value for input argument #%d: Must be in the interval [%ls, %ls].\n"), L"delip", 1, L"0", L"+INF");
+            return types::Function::Error;
+        }
+        else if(pdblIn1[i] > 1)
+        {
+            bBecomeComplex = true;
+        }
+    }
+
+    //check second input parameter : ck
+    if(in[1]->isDouble() == false || in[1]->getAs<types::Double>()->isScalar() == false || in[1]->getAs<types::Double>()->isComplex() == true)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Real scalar expected.\n"), L"delip", 2);
+        return types::Function::Error;
+    }
+
+    double pdblCK = in[1]->getAs<types::Double>()->get(0);
+    if(pdblCK < -1 || pdblCK > 1)
+    {
+      ScierrorW(999, _W("%ls: Wrong value for input argument #%d: Must be in the interval [%ls, %ls].\n"), L"delip", 2, L"-1", L"1");
+      return types::Function::OK;
+    }
+
+    //alloc output parameter
+    types::Double* pOut = new types::Double(pIn1->getRows(), pIn1->getCols(), true);
+
+    //call math function
+    C2F(delip)(&iSize, pOut->getReal(), pOut->getImg(), pIn1->get(), &pdblCK);
+
+    //update complexity of output parameter
+    pOut->setComplex(bBecomeComplex);
+
+    out.push_back(pOut);
+    return types::Function::OK;
+}
diff --git a/scilab/modules/signal_processing/sci_gateway/cpp/sci_fft.cpp b/scilab/modules/signal_processing/sci_gateway/cpp/sci_fft.cpp
new file mode 100644 (file)
index 0000000..6509b3b
--- /dev/null
@@ -0,0 +1,307 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2011 - DIGITEO - Antoine ELIAS
+*
+* 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 "signal_gw.hxx"
+#include "double.hxx"
+#include "function.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "elem_common.h"
+
+extern void C2F(fft842)(int *inverse, int *signal_length, double *signal_real, double *signal_imaginary, int *error);
+extern void C2F(dfft2)(double *signal_real, double *signal_imaginary, int *nseg, int *n, int *nspn, int *inverse, int *error, int *buffer_data, int *buffer_size);
+}
+
+#define POW2_15     32768
+
+bool isPowerOf2(int _iVal);
+
+int maxfactor(int n);
+int fft_1dim(double *signal_real, double *signal_imaginary, int signal_length, int inverse, int *buffer_data, int buffer_size);
+int fft_2dim(double *signal_real, double *signal_imaginary, int signal_rows, int signal_cols, int inverse, int *buffer_data, int buffer_size);
+int fft_ndim(double *signal_real, double *signal_imaginary, int signal_length, int dimensions_length, int dimension_stride, int inverse, int *buffer_data, int buffer_size);
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_fft(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int iDimLength          = 0;
+    int iDimCount           = 0;
+    int iInc                = 0;
+    int iWay                = -1;
+    int iSize               = 0;
+    int iOne                = 1;
+    int iErr                = 0;
+    double dblZero          = 0;
+
+    //workspace
+    int iWS                 = 0;
+    int* piWS               = NULL;
+    types::Double* pIn1     = NULL;
+
+    //check input parameters
+    if(in.size() != 1 && in.size() != 2 && in.size() != 4)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d or %d expected.\n"), L"fft", 1, 4);
+        return types::Function::Error;
+    }
+
+    switch(in.size())
+    {
+    case 4 :
+        //check fourth input parameter : inc
+        if(in[3]->isDouble() == false || in[3]->getAs<types::Double>()->isScalar() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Scalar expected.\n"), L"fft", 4);
+            return types::Function::Error;
+        }
+
+        iInc = (int)in[3]->getAs<types::Double>()->get(0);
+
+        //check third input parameter : dim
+        if(in[2]->isDouble() == false || in[2]->getAs<types::Double>()->isScalar() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Scalar expected.\n"), L"fft", 3);
+            return types::Function::Error;
+        }
+
+        iDimLength = (int)in[2]->getAs<types::Double>()->get(0);
+        iDimCount = 3; //any value > 2 (used as a flag) 
+
+    case 2 : 
+        //check third input parameter : way
+        if(in[1]->isDouble() == false || in[1]->getAs<types::Double>()->isScalar() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Scalar expected.\n"), L"fft", 2);
+            return types::Function::Error;
+        }
+
+        iWay = (int)in[1]->getAs<types::Double>()->get(0);
+        if(iWay != -1 && iWay != 1)
+        {
+            ScierrorW(999, _W("%ls: Wrong value for input argument #%d: Must be in the set {%ls}.\n"), L"fft", 2, "-1 1");
+            return types::Function::Error;
+        }
+
+    case 1:
+        if(in[0]->isDouble() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Scalar expected.\n"), L"fft", 1);
+            return types::Function::Error;
+        }
+
+        pIn1 = in[0]->getAs<types::Double>();
+
+        iDimCount = Max(iDimCount, ((pIn1->getRows() == 1 || pIn1->getCols() == 1) ? 1 : 2));
+        iSize = pIn1->getSize();
+        break;
+    default :
+        {
+            ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d eor %d xpected.\n"), L"fft", 1, 4);
+            return types::Function::Error;
+        }
+    }
+
+    types::Double* pOut = pIn1->clone()->getAs<types::Double>();
+    pOut->setComplex(true);
+
+    //alloc workspace required by dfft2
+    iWS = 8 * maxfactor(iSize) + 24;
+    piWS = (int*)MALLOC(iWS * sizeof(int));
+    if (piWS == NULL)
+    {
+        ScierrorW(999, _W("%ls : Memory allocation error.\n"), L"fft");
+        return types::Function::Error;
+    }
+
+    switch(iDimCount)
+    {
+    case 1 :
+        iErr = fft_1dim(pOut->getReal(), pOut->getImg(), iSize, iWay, piWS, iWS);
+        break;
+    case 2 :
+        iErr = fft_2dim(pOut->getReal(), pOut->getImg(), pOut->getRows(), pOut->getCols(), iWay, piWS, iWS);
+        if(iErr == 1)
+        {
+            ScierrorW(999, _W("%ls : Memory allocation error.\n"), L"fft");
+            return types::Function::Error;
+        }
+        break;
+    default :
+        iErr = fft_ndim(pOut->getReal(), pOut->getImg(), iSize, iDimLength, iInc, iWay, piWS, iWS);
+        break;
+    }
+
+    FREE(piWS);
+
+    out.push_back(pOut);
+    return types::Function::OK;
+}
+
+int fft_1dim(double *signal_real, double *signal_imaginary, int signal_length, int inverse, int *buffer_data, int buffer_size)
+{
+    int error = 0;
+    int one = 1;
+
+    if(isPowerOf2(signal_length) && signal_length < POW2_15)
+    {
+        C2F(fft842)(&inverse, &signal_length, signal_real, signal_imaginary, &error);
+    }
+    else
+    {
+        C2F(dfft2)(signal_real, signal_imaginary, &one, &signal_length, &one, &inverse, &error, buffer_data, &buffer_size);
+    }
+
+    return error;
+}
+
+int fft_2dim(double *signal_real, double *signal_imaginary, int signal_rows, int signal_cols, int inverse, int *buffer_data, int buffer_size)
+{
+    int error = 0;
+    int one = 1;
+
+    if(isPowerOf2(signal_rows) && signal_rows < POW2_15)
+    {
+        for (int i = 0 ; i < signal_cols ; i++)
+        {
+            C2F(fft842)(&inverse, &signal_rows, &(signal_real[signal_rows * i]), &(signal_imaginary[signal_rows * i]), &error);
+        }
+    }
+    else
+    {
+        C2F(dfft2)(signal_real, signal_imaginary, &signal_cols, &signal_rows, &one, &inverse, &error, buffer_data, &buffer_size);
+    }
+
+    if(isPowerOf2(signal_cols) && signal_cols < POW2_15)
+    {
+        double* temp_real = NULL;
+        double* temp_imaginary = NULL;
+
+        temp_real = (double *)MALLOC(signal_cols * sizeof(double));
+        temp_imaginary = (double *)MALLOC(signal_cols * sizeof(double));
+
+        if(temp_real == NULL || temp_imaginary == NULL)
+        {
+            return 1;
+        }
+
+        for (int i = 0 ; i < signal_rows ; i++)
+        {
+            C2F(dcopy)(&signal_cols, &(signal_real[i]),&signal_rows, temp_real, &one);
+            C2F(dcopy)(&signal_cols, &(signal_imaginary[i]), &signal_rows, temp_imaginary, &one);
+            C2F(fft842)(&inverse, &signal_cols, temp_real, temp_imaginary, &error);
+            C2F(dcopy)(&signal_cols, temp_real, &one, &(signal_real[i]), &signal_rows);
+            C2F(dcopy)(&signal_cols, temp_imaginary, &one, &(signal_imaginary[i]), &signal_rows);
+        }
+
+        FREE(temp_imaginary);
+        temp_imaginary = NULL;
+        free(temp_real);
+        temp_real = NULL;
+    }
+    else
+    { /* erroneous implementation suspected */
+        C2F(dfft2)(signal_real, signal_imaginary, &one, &signal_cols, &signal_rows, &inverse, &error, buffer_data, &buffer_size);
+    }
+
+    return error;
+}
+
+int fft_ndim(double *signal_real, double *signal_imaginary, int signal_length, int dimensions_length, int dimension_stride, int inverse, int *buffer_data, int buffer_size)
+{
+    /* translated litterally from Fortran... but... wtf ?! */
+    int error = 0;
+    int nseg = signal_length / dimensions_length / dimension_stride;
+    C2F(dfft2)(signal_real, signal_imaginary, &nseg, &dimensions_length, &dimension_stride, &inverse, &error, buffer_data, &buffer_size);
+    return error;
+}
+
+
+int maxfactor(int n)
+{
+    int nfac[15];
+    int m = 0, j = 0, jj = 0, k = 0, kt = 0, max = 0;
+
+    for (k = abs(n) ; k % 16 == 0 ; k /= 16)
+    {
+        m++;
+        nfac[m - 1] = 4;
+    }
+    
+    for (j = 3, jj = 9 ; jj <= k ; j += 2, jj = j*j)
+    {
+        if(k % jj != 0)
+        {
+            continue;
+        }
+        m++;
+        nfac[m - 1] = j;
+        k /= jj;
+    }
+
+    if(k <= 4)
+    {
+        kt = m;
+        nfac[m] = k;
+        if(k != 1)
+        {
+            m++;
+        }
+    }
+    else
+    {
+        if(k % 4 == 0)
+        {
+            m++;
+            nfac[m - 1] = 2;
+            k /= 4;
+        }
+        
+        kt = m;
+        for (j = 2 ; j <= k ; j = ((j + 1) / 2) * 2 + 1)
+        {
+            if(k % j != 0)
+            {
+                continue;
+            }
+
+            m++;
+            nfac[m - 1] = j;
+            k /= j;
+        }
+    }
+
+    if(kt != 0)
+    {
+        for (j = kt ; j > 0 ; j--)
+        {
+            m++;
+            nfac[m - 1] = nfac[j - 1];
+        }
+    }
+
+    /* get nfac maximum */
+    for (j = 0, max = nfac[0]; j < m ; j++)
+    {
+        max = (nfac[j] > max) ? nfac[j] : max;
+    }
+
+    return max;
+}
+
+bool isPowerOf2(int _iVal)
+{
+    return (_iVal & (_iVal - 1)) == 0;
+}
diff --git a/scilab/modules/signal_processing/sci_gateway/cpp/sci_rpem.cpp b/scilab/modules/signal_processing/sci_gateway/cpp/sci_rpem.cpp
new file mode 100644 (file)
index 0000000..a8f8486
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2011 - DIGITEO - Cedric DELAMARRE
+*
+* 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 "signal_gw.hxx"
+#include "list.hxx"
+#include "double.hxx"
+#include "function.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+
+
+extern void C2F(rpem)(double theta[], double p[],
+                     int *order,
+                     double *u, double *y, double *lambda, double *k, double *c,
+                     int *istab2,
+                     double *v, double *eps, double *eps1,
+                     int *dimension,
+                     double phi[], double psi[], double tstab[],
+                     double work[], double f[], double g[], double l[]);
+}
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_rpem(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    double* data    = NULL;
+    double* u       = NULL;
+    double* y       = NULL;
+    double* tstab   = NULL;
+    double* work    = NULL;
+    double* f       = NULL;
+    double* g       = NULL;
+
+    double v        = 0;
+    double eps      = 0;
+    double eps1     = 0;
+    
+    double lambda   = 0.950l;
+    double alpha    = 0.990l;
+    double beta     = 0.01l;
+    double kappa    = 0.000l;
+    double mu       = 0.980l;
+    double nu       = 0.020l;
+    double c        = 1000.0l;
+
+    int order       = 0;
+    int dimension   = 0;
+    int istab2      = 0;
+    int u_length    = 0;
+
+    types::Double* dTheta   = NULL;
+    types::Double* dP       = NULL;
+    types::Double* dPhi     = NULL;
+    types::Double* dPsi     = NULL;
+    types::Double* dL       = NULL;
+
+    if(in.size() < 3 || in.size() > 6)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"rpem", 3, 6);
+        return types::Function::Error;
+    }
+
+    /* arg1: w0 = list(theta, p, l, phi, psi) */
+    if((in[0]->isList() == false) || in[0]->getAs<types::List>()->getSize() != 5)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: %d-element list expected.\n"), L"rpem", 1, 5);
+        return types::Function::Error;
+    }
+
+    types::List* w0 = in[0]->getAs<types::List>();
+    for(int i=0; i<5; i++)
+    {
+        if(!w0->get(i)->isDouble() || w0->get(i)->getAs<types::Double>()->isComplex())
+        {
+            ScierrorW(77, _W("%ls: Wrong type for element %d of input argument #%d: A matrix of real expected.\n"), L"rpem", i+1, 1);
+            return types::Function::Error;
+        }
+        types::Double* current = w0->get(i)->getAs<types::Double>();
+        switch(i)
+        {
+            case 0:  /* theta: 3n real ranged row vector */
+            {
+                if (current->getRows() != 1)
+                {
+                    ScierrorW(77, _W("%ls: Wrong size for element %d of input argument #%d: A row vector expected.\n"), L"rpem", i+1, 1);
+                    return types::Function::Error;
+                }
+                if (current->getCols() % 3 != 0)
+                {
+                    ScierrorW(77, _W("%ls: Wrong size for element %d of input argument #%d: Size must be multiple of %d.\n"), L"rpem", i+1, 1, 3);
+                    return types::Function::Error;
+                }
+                dimension = current->getCols();
+                order = dimension / 3;
+                dTheta = new types::Double(1, dimension);
+                dTheta->set(current->get());
+            }
+            break;       
+            case 1:  /* p: 3n x 3n real ranged matrix */
+            {
+                if (current->getRows() != dimension || current->getCols() != dimension)
+                {
+                    ScierrorW(77, _W("%ls: Wrong size for element %d of input argument #%d: A square matrix expected.\n"), L"rpem", i+1, 1);
+                    return types::Function::Error;
+                }
+                dP = new types::Double(dimension, dimension);
+                dP->set(current->get());
+            }
+            break;
+            case 2:  /* l: 3n real ranged row vector */
+            case 3:  /* phi: 3n real ranged row vector */
+            case 4:  /* psi: 3n real ranged row vector */
+            {
+                if (current->getRows() != 1 || current->getCols() != dimension)
+                {
+                    ScierrorW(77, _W("%ls: Wrong size for element %d of input argument #%d: Same sizes of element %d expected.\n"), L"rpem", i+1, 1, 1);
+                    return types::Function::Error;
+                }
+            }
+        }
+    }
+
+    dL      = new types::Double(1, dimension);
+    dPhi    = new types::Double(1, dimension);
+    dPsi    = new types::Double(1, dimension);
+
+    dL->set(w0->get(2)->getAs<types::Double>()->get());
+    dPhi->set(w0->get(3)->getAs<types::Double>()->get());
+    dPsi->set(w0->get(4)->getAs<types::Double>()->get());
+
+    /* arg2: u0: real ranged row vector */
+    if((in[1]->isDouble() == false) || in[1]->getAs<types::Double>()->getRows() != 1)
+    {
+        ScierrorW(999, _W("%ls: Wrong size for input argument #%d: A row vector expected.\n"), L"rpem", 2);
+        return types::Function::Error;
+    }
+    u = in[1]->getAs<types::Double>()->get();
+    u_length = in[1]->getAs<types::Double>()->getCols();
+
+    /* arg3: y0: real ranged row vector of same length as u0 */
+    if((in[2]->isDouble() == false) || in[2]->getAs<types::Double>()->getRows() != 1)
+    {
+        ScierrorW(999, _W("%ls: Wrong size for input argument #%d: A row vector expected.\n"), L"rpem", 3);
+        return types::Function::Error;
+    }
+    if(in[2]->getAs<types::Double>()->getCols() != u_length)
+    {
+        ScierrorW(999, _W("%ls: Incompatible input arguments #%d and #%d: Same column dimensions expected.\n"), L"rpem", 2, 3);
+        return types::Function::Error;
+    }
+    y = in[2]->getAs<types::Double>()->get();
+
+    /* optional arguments */
+    switch(in.size())
+    {
+        case 6: /* c */
+        {
+            if((in[5]->isDouble() == false) || !in[5]->getAs<types::Double>()->isScalar())
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d: A scalar expected.\n"), L"rpem", 6);
+                return types::Function::Error;
+            }
+            c = in[5]->getAs<types::Double>()->get(0);
+        }
+        case 5: /* [kappa, mu, nu] */
+        {
+            if((in[4]->isDouble() == false) || (in[4]->getAs<types::Double>()->getRows() != 1) || (in[4]->getAs<types::Double>()->getCols() != 3))
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d: A %d-by-%d matrix expected.\n"), L"rpem", 5, 1, 3);
+                return types::Function::Error;
+            }
+            data    = in[4]->getAs<types::Double>()->get();
+            kappa   = data[0];
+            mu      = data[1];
+            nu      = data[2];
+        }
+        case 4: /* [lambda, alpha, beta] */
+        {
+            if((in[3]->isDouble() == false) || (in[3]->getAs<types::Double>()->getRows() != 1) || (in[3]->getAs<types::Double>()->getCols() != 3))
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d: A %d-by-%d matrix expected.\n"), L"rpem", 4, 1, 3);
+                return types::Function::Error;
+            }
+            data    = in[3]->getAs<types::Double>()->get();
+            lambda  = data[0];
+            alpha   = data[1];
+            beta    = data[2];
+        }
+    }
+
+    /*** algorithm call ***/
+
+    /* references provided to justify allocation with code relying on it */
+    f = (double *) MALLOC((dimension) * sizeof(double));        /* rpem.f l.168 */
+    memset(f,0x00,(dimension) * sizeof(double));
+    g = (double *) MALLOC((dimension) * sizeof(double));        /* rpem.f l.169 */
+    memset(g,0x00,(dimension) * sizeof(double));
+    tstab = (double *) MALLOC((order + 1) * sizeof(double));    /* rpem.f l.105 */
+    memset(tstab,0x00,(order + 1) * sizeof(double));
+    work = (double *) MALLOC((2 * order + 2) * sizeof(double)); /* nstabl.f */
+    memset(work,0x00,(2 * order + 2) * sizeof(double));
+    /* (tip: bound variables to determine required memory: nk1 <= ordre + 1) */
+
+    for (int i = 1 ; i < u_length ; ++i) 
+    {
+        C2F(rpem)(  dTheta->get(), dP->get(), &order, &(u[i-1]), &(y[i]), &lambda, &kappa, &c,
+                    &istab2, &v, &eps, &eps1, //output
+                    &dimension, dPhi->get(), dPsi->get(),
+                    tstab,work, //output
+                    f, g, dL->get());
+
+        lambda = alpha * lambda + beta;
+        kappa = mu * kappa + nu;
+    }
+
+    FREE(work);
+    FREE(tstab);
+    FREE(g);
+    FREE(f);
+
+    /*** output formatting ***/
+  
+    types::List* resultList = new types::List();
+    resultList->append(dTheta);
+
+    resultList->append(dP);
+    resultList->append(dL);
+    resultList->append(dPhi);
+    resultList->append(dPsi);
+
+    out.push_back(resultList);
+
+    if (_iRetCount == 2) 
+    {
+        types::Double* dV = new types::Double(1, 1);
+        dV->set(&v);
+        out.push_back(dV);
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/signal_processing/sci_gateway/cpp/sci_syredi.cpp b/scilab/modules/signal_processing/sci_gateway/cpp/sci_syredi.cpp
new file mode 100644 (file)
index 0000000..69fa104
--- /dev/null
@@ -0,0 +1,368 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2011 - DIGITEO - Antoine ELIAS
+*
+* 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 "signal_gw.hxx"
+#include "double.hxx"
+#include "function.hxx"
+
+extern "C"
+{
+#include <math.h>
+#include "localization.h"
+#include "Scierror.h"
+#include "core_math.h"
+
+extern void C2F(syredi)(int *maxdeg, int *ityp, int *iapro,
+    double *om, double *adelp, double *adels,
+    /* outputs */
+    int *deg_count, int *zeros_count,
+    double *fact,
+    double *b2, double *b1, double *b0,
+    double *c1, double *c0,
+    double *zzr, double *zzi,
+    double *zpr, double *zpi,
+    int *ierr,
+    /* working buffers */
+    double *spr, double *spi,
+    double *pren, double *pimn,
+    double *zm, double *sm, double *rom,
+    /* v-- doutful types but whatever... */
+    double *nzero, double *nze);
+}
+
+enum filter_type
+{
+    low_pass = 1,
+    high_pass = 2,
+    band_pass = 3,
+    stop_band = 4
+};
+
+enum design_type
+{
+    butterworth = 1,
+    elliptic = 2,
+    chebytchev1 = 3,
+    chebytchev2 = 4
+};
+
+#define OUT_COUNT 18
+
+//local functions
+double maximum(double* _pDblVal, int _iSize);
+double minimum(double* _pDblVal, int _iSize);
+bool isSortedAscending(double* _pdblVal, int _iSize);
+void reshapeFilters(types::Double* _pDblInR, types::Double* _pDblInI, types::Double* _pDblOut);
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_syredi(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int iMaxDeg                         = 64;
+    types::Double *pDblType             = NULL;
+    filter_type iType;
+
+    types::Double *pDblAppro            = NULL;
+    design_type iAppro;
+    
+    types::Double *pDblCutOff           = NULL;
+
+    types::Double *pDblDeltaP           = NULL;
+    double dblDeltaP                    = 0;
+
+    types::Double *pDblDeltaS           = NULL;
+    double dblDeltaS                    = 0;
+
+    types::Double* pDblOut[OUT_COUNT];
+    int piOutSize[OUT_COUNT]            = {32, 32, 32, 32, 32, 64, 64, 64, 64, 64, 64, 64, 64, 256, 256, 16, 64, 64};
+
+    int iErr                            = 0;
+    int iZeroCount                      = 0;
+    int iDegCount                       = 0;
+
+    types::Double* pDblFact             = NULL;
+    double dblFact                      = 0;
+
+    types::Double* pOut                 = NULL;
+
+    //check input parameters
+    if(in.size() != 5)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"syredi", 5);
+        return types::Function::Error;
+    }
+
+    //check 1st input parameter : filter type ( 1 int )
+    pDblType = in[0]->getAs<types::Double>();
+    if(in[0]->isDouble() == false || pDblType->isScalar() == false || pDblType->isComplex() == true)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for argument %d: Real scalar expected.\n"), L"syredi", 1);
+        return types::Function::Error;
+    }
+
+    iType = (filter_type)(int)in[0]->getAs<types::Double>()->get(0);
+
+    //check 2nd input parameter : approximation type ( 1 int )
+    pDblAppro = in[1]->getAs<types::Double>();
+    if(in[1]->isDouble() == false || pDblAppro->isScalar() == false || pDblAppro->isComplex() == true)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Real scalar expected.\n"), L"syredi", 2);
+        return types::Function::Error;
+    }
+
+    iAppro = (design_type)(int)in[1]->getAs<types::Double>()->get(0);
+
+    //check 3rd input parameter : cuttof frequencies ( 4-row vector )
+    pDblCutOff = in[2]->getAs<types::Double>();
+    if(in[2]->isDouble() == false || pDblCutOff->getSize() != 4 || pDblCutOff->getCols() != 4)
+    {
+        ScierrorW(999, _W("%ls: Wrong size for input argument #%d: A %d-by-%d array expected.\n"), L"syredi", 3, 1, 4);
+        return types::Function::Error;
+    }
+
+    if(minimum(pDblCutOff->get(), pDblCutOff->getSize()) < 0 || minimum(pDblCutOff->get(), pDblCutOff->getSize()) > M_PI)
+    {
+        ScierrorW(999, _W("%ls: Wrong value for input argument #%d: Must be in the interval [%ls, %ls].\n"), L"syredi", 3, L"0", L"%pi");
+        return types::Function::Error;
+    }
+
+    if((iType == low_pass || iType == high_pass) && isSortedAscending(pDblCutOff->get(), 2) == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong values for input argument #%d: Elements must be in increasing order.\n"), L"syredi", 3);
+        return types::Function::Error;
+    }
+
+    if((iType == band_pass || iType == stop_band) && isSortedAscending(pDblCutOff->get(), 4) == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong values for input argument #%d: Elements must be in increasing order.\n"), L"syredi", 3);
+        return types::Function::Error;
+    }
+
+    //check 4th input parameter : ripple in passband ( 0 < deltap < 1 )
+    pDblDeltaP = in[3]->getAs<types::Double>();
+    if(in[3]->isDouble() == false || pDblAppro->isScalar() == false || pDblAppro->isComplex() == true)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Real scalar expected.\n"), L"syredi", 4);
+        return types::Function::Error;
+    }
+
+    dblDeltaP = pDblDeltaP->get(0);
+
+    //check 5th input parameter : ripple in stopband ( 0 < deltas < 1 )
+    pDblDeltaS = in[4]->getAs<types::Double>();
+    if(in[4]->isDouble() == false || pDblDeltaS->isScalar() == false || pDblDeltaS->isComplex() == true)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Real scalar expected.\n"), L"syredi", 5);
+        return types::Function::Error;
+    }
+
+    dblDeltaS = pDblDeltaS->get(0);
+
+
+    //alloc temporary variables
+    for(int i = 0 ; i < OUT_COUNT ; i++)
+    {
+        pDblOut[i] = new types::Double(1, piOutSize[i]);
+    }
+
+    //call math function
+    C2F(syredi)(&iMaxDeg, (int*)&iType, (int*)&iAppro, pDblCutOff->get(), &dblDeltaP,
+        &dblDeltaS, &iZeroCount, &iDegCount, &dblFact, 
+        pDblOut[0]->get(), pDblOut[1]->get(), pDblOut[2]->get(), pDblOut[3]->get(),
+        pDblOut[4]->get(), pDblOut[5]->get(), pDblOut[6]->get(), pDblOut[7]->get(),
+        pDblOut[8]->get(), &iErr, pDblOut[9]->get(), pDblOut[10]->get(), pDblOut[11]->get(),
+        pDblOut[12]->get(), pDblOut[13]->get(), pDblOut[14]->get(), pDblOut[15]->get(),
+        pDblOut[16]->get(), pDblOut[17]->get());
+
+    if(iErr)
+    {
+        if(iErr == -7)
+        {
+            ScierrorW(999, _W("%ls: specs => invalid order filter.\n"), L"syredi");
+            return types::Function::Error;
+        }
+        else if(iErr == -9)
+        {
+            ScierrorW(999, _W("%ls: specs => too high order filter.\n"), L"syredi");
+            return types::Function::Error;
+        }
+        else
+        {
+            ScierrorW(999, _W("%ls: error in function syredi.\n"), L"syredi");
+            return types::Function::Error;
+        }
+    }
+
+    //1st output : fact
+    pDblFact = new types::Double(dblFact);
+    out.push_back(pDblFact);
+
+    //2nd output : b2
+    pOut = new types::Double(1, iDegCount);
+    pOut->set(pDblOut[0]->get());
+    out.push_back(pOut);
+
+    //3rd output : b1
+    pOut = new types::Double(1, iDegCount);
+    pOut->set(pDblOut[1]->get());
+    out.push_back(pOut);
+
+    //4th output : b0
+    pOut = new types::Double(1, iDegCount);
+    pOut->set(pDblOut[2]->get());
+    out.push_back(pOut);
+
+    //5th output : c1
+    pOut = new types::Double(1, iDegCount);
+    pOut->set(pDblOut[3]->get());
+    out.push_back(pOut);
+
+    //6th output : c0
+    pOut = new types::Double(1, iDegCount);
+    pOut->set(pDblOut[4]->get());
+    out.push_back(pOut);
+
+    //7th output : zeros
+    pOut = new types::Double(1, iZeroCount, true);
+    reshapeFilters(pDblOut[5], pDblOut[6], pOut);
+    out.push_back(pOut);
+
+    //8th output : poles
+    pOut = new types::Double(1, iZeroCount, true);
+    reshapeFilters(pDblOut[7], pDblOut[8], pOut);
+    out.push_back(pOut);
+
+    //clear temporary variables
+    for(int i = 0 ; i < OUT_COUNT ; i++)
+    {
+        delete pDblOut[i];
+    }
+
+    return types::Function::OK;
+}
+
+/* returns the maximum of the values array (with length elements) */
+double maximum(double* _pDblVal, int _iSize)
+{
+    double dblMax = 0;
+    if(_iSize < 1)
+    {
+        return dblMax;
+    }
+
+    dblMax = _pDblVal[0];
+    for(int i = 1 ; i < _iSize ; i++)
+    {
+        dblMax = Max(_pDblVal[i], dblMax);
+    }
+    return dblMax;
+}
+
+/* returns the minimum of the values array (with length elements) */
+double minimum(double* _pDblVal, int _iSize)
+{
+    double dblMin = 0;
+    if(_iSize < 1)
+    {
+        return dblMin;
+    }
+
+    dblMin = _pDblVal[0];
+    for(int i = 1 ; i < _iSize ; i++)
+    {
+        dblMin = Min(_pDblVal[i], dblMin);
+    }
+    return dblMin;
+}
+
+bool isSortedAscending(double* _pdblVal, int _iSize)
+{
+    for(int i = 1 ; i < _iSize ; i++)
+    {
+        if(_pdblVal[i - 1] > _pdblVal[i])
+        {
+            return false;
+        }
+    }
+    return true;
+}
+
+int syredi_buffered(/* inputs */
+    enum filter_type filter, enum design_type design,
+    double cutoff_frequencies[4], double ripple_passband, double ripple_stopband,
+    /* outputs */
+    int *zeros_count, int *deg_count, double *fact,
+    double b2[], double b1[], double b0[],
+    double c1[], double c0[],
+    double zzr[], double zzi[],
+    double zpr[], double zpi[])
+{
+#define BUFFERS_COUNT 9
+    const int buffers_count = BUFFERS_COUNT;
+    int buffers_sizes[BUFFERS_COUNT] = {64, 64, 64, 64, 256, 256, 16, 64, 64};
+    double *buffers[BUFFERS_COUNT];
+#undef BUFFERS_COUNT
+    int maxdeg = 64, error = 1, i;
+
+    for (i = 0 ; i < buffers_count ; ++i) {
+        buffers[i] = (double *)MALLOC(buffers_sizes[i] * sizeof(double));
+        if (buffers[i] == NULL) {
+            break;
+        }
+    }
+    if (i == buffers_count) {
+        C2F(syredi)(/* inputs */
+            &maxdeg, (int *) &filter, (int *) &design,
+            cutoff_frequencies, &ripple_passband, &ripple_stopband,
+            /* outputs */
+            zeros_count, deg_count, fact,
+            b2, b1, b0, c1, c0,
+            zzr, zzi, zpr, zpi,
+            &error,
+            /* buffers */
+            buffers[0], buffers[1], buffers[2], buffers[3],
+            buffers[4], buffers[5],
+            buffers[6],
+            buffers[7], buffers[8]);
+    }
+    for (i-- ; i >= 0 ; i--) {
+        FREE(buffers[i]);
+        buffers[i] = NULL;
+    }
+    return error;
+}
+
+void reshapeFilters(types::Double* _pDblInR, types::Double* _pDblInI, types::Double* _pDblOut)
+{
+    int iSize           = _pDblOut->getSize();
+    double* pdblInR     = _pDblInR->getReal();
+    double* pdblInI     = _pDblInI->getReal();
+    double* pdblOutR    = _pDblOut->getReal();
+    double* pdblOutI    = _pDblOut->getImg();
+
+    for(int i = 0, j = 0 ; j < iSize ; i++,j++)
+    {
+        if(pdblInI[i] == 0)
+        {
+            pdblOutR[j] = pdblInR[i];
+            pdblOutI[j] = 0;
+        }
+        else
+        {
+            pdblOutR[j] = pdblInR[i];
+            pdblOutI[j] = pdblInI[i];
+            j++;
+            pdblOutR[j] = pdblInR[i];
+            pdblOutI[j] = - pdblInI[i];
+        }
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/signal_processing/sci_gateway/cpp/signal_gw.cpp b/scilab/modules/signal_processing/sci_gateway/cpp/signal_gw.cpp
new file mode 100644 (file)
index 0000000..73985d8
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2011 - DIGITEO - Cedric DELAMARRE
+ *
+ *  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 "context.hxx"
+#include "function.hxx"
+#include "signal_gw.hxx"
+
+extern "C"
+{
+    #include "gw_signal.h"
+}
+
+#define MODULE_NAME L"signal_processing"
+
+int SignalProcessingModule::Load()
+{
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"remez", &sci_remez, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rpem", &sci_rpem, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"corr", &sci_corr, MODULE_NAME));
+   // symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ffir", &sci_ffir, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"fft", &sci_fft, MODULE_NAME));
+   // symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"fiir", &sci_fiir, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"amell", &sci_amell, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"delip", &sci_delip, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"syredi", &sci_syredi, MODULE_NAME));
+
+    return true;
+}
diff --git a/scilab/modules/signal_processing/sci_gateway/cpp/signal_processing_gw.vcxproj b/scilab/modules/signal_processing/sci_gateway/cpp/signal_processing_gw.vcxproj
new file mode 100644 (file)
index 0000000..5620a1d
--- /dev/null
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{A968A82E-B2DC-4ED2-BD9B-12C1E97ABBB4}</ProjectGuid>
+    <RootNamespace>signal_processing_gw</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SIGNAL_PROCESSING_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <TargetMachine>MachineX86</TargetMachine>
+      <AdditionalDependencies>../../src/c/signal_processing_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SIGNAL_PROCESSING_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <TargetMachine>MachineX64</TargetMachine>
+      <AdditionalDependencies>../../src/c/signal_processing_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SIGNAL_PROCESSING_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <TargetMachine>MachineX86</TargetMachine>
+      <AdditionalDependencies>../../src/c/signal_processing_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../operations/includes;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../elementary_functions/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SIGNAL_PROCESSING_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+    </ClCompile>
+    <Link>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <TargetMachine>MachineX64</TargetMachine>
+      <AdditionalDependencies>../../src/c/signal_processing_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\includes\dynlib_signal_processing_gw.h" />
+    <ClInclude Include="..\..\includes\signal_gw.hxx" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="sci_delip.cpp" />
+    <ClCompile Include="sci_fft.cpp" />
+    <ClCompile Include="sci_rpem.cpp" />
+    <ClCompile Include="sci_corr.cpp" />
+    <ClCompile Include="sci_syredi.cpp" />
+    <ClCompile Include="signal_gw.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
+      <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
+      <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\symbol\symbol.vcxproj">
+      <Project>{2c60033b-0dbd-4ca4-80d3-176c9be9ce2f}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\types\types.vcxproj">
+      <Project>{64e090da-dcb5-4f4d-93d7-e88ddec9c2ef}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\src\c\signal_processing.vcxproj">
+      <Project>{a3ad381e-c0dd-45bb-acb2-c0a0db33a606}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Library Include="..\..\..\..\bin\blasplus.lib" />
+    <Library Include="..\..\..\..\bin\libintl.lib" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/signal_processing/sci_gateway/cpp/signal_processing_gw.vcxproj.filters b/scilab/modules/signal_processing/sci_gateway/cpp/signal_processing_gw.vcxproj.filters
new file mode 100644 (file)
index 0000000..c0dc3b7
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\includes\dynlib_signal_processing_gw.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\includes\signal_gw.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="sci_rpem.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="signal_gw.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_corr.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_delip.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_fft.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_syredi.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <Library Include="..\..\..\..\bin\libintl.lib" />
+    <Library Include="..\..\..\..\bin\blasplus.lib" />
+  </ItemGroup>
+</Project>
\ No newline at end of file
index 788270a..c343bae 100644 (file)
@@ -33,10 +33,3 @@ unsfdcopy_
 intersci_
 com_
 vstk_
-
-; ---------------------------------------
-; elementary functions
-; ---------------------------------------
-entier_
-simple_
-dset_
index 0e81462..8bc4061 100644 (file)
@@ -77,7 +77,7 @@
     <ClCompile>
       <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../output_stream/includes;../../../localization/includes;../../../dynamic_link/includes;../../../string/includes;../../../core/includes;../../../../libs/intl;../../../statistics/includes;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../output_stream/includes;../../../localization/includes;../../../dynamic_link/includes;../../../string/includes;../../../core/includes;../../../../libs/intl;../../../statistics/includes;../../../api_scilab/includes;../../../operations/includes;../../../types/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;SIGNAL_PROCESSING_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
@@ -94,7 +94,7 @@ lib /DEF:"$(ProjectDir)signal_processing_f_Import.def" /SUBSYSTEM:WINDOWS /MACHI
 </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>LibScilab.lib;signal_processing_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>LibScilab.lib;signal_processing_f.lib;../../../../bin/elementary_functions_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ModuleDefinitionFile>
       </ModuleDefinitionFile>
@@ -114,7 +114,7 @@ lib /DEF:"$(ProjectDir)signal_processing_f_Import.def" /SUBSYSTEM:WINDOWS /MACHI
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../output_stream/includes;../../../localization/includes;../../../dynamic_link/includes;../../../string/includes;../../../core/includes;../../../../libs/intl;../../../statistics/includes;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../output_stream/includes;../../../localization/includes;../../../dynamic_link/includes;../../../string/includes;../../../core/includes;../../../../libs/intl;../../../statistics/includes;../../../api_scilab/includes;../../../operations/includes;../../../types/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;SIGNAL_PROCESSING_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
@@ -131,7 +131,7 @@ lib /DEF:"$(ProjectDir)signal_processing_f_Import.def" /SUBSYSTEM:WINDOWS /MACHI
 </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>LibScilab.lib;signal_processing_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>LibScilab.lib;signal_processing_f.lib;../../../../bin/elementary_functions_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ModuleDefinitionFile>
       </ModuleDefinitionFile>
@@ -152,7 +152,7 @@ lib /DEF:"$(ProjectDir)signal_processing_f_Import.def" /SUBSYSTEM:WINDOWS /MACHI
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../output_stream/includes;../../../localization/includes;../../../dynamic_link/includes;../../../string/includes;../../../core/includes;../../../../libs/intl;../../../statistics/includes;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../output_stream/includes;../../../localization/includes;../../../dynamic_link/includes;../../../string/includes;../../../core/includes;../../../../libs/intl;../../../statistics/includes;../../../api_scilab/includes;../../../operations/includes;../../../types/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;SIGNAL_PROCESSING_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -170,7 +170,7 @@ lib /DEF:"$(ProjectDir)signal_processing_f_Import.def" /SUBSYSTEM:WINDOWS /MACHI
 </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>LibScilab.lib;signal_processing_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>LibScilab.lib;signal_processing_f.lib;../../../../bin/elementary_functions_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ModuleDefinitionFile>
       </ModuleDefinitionFile>
@@ -197,7 +197,7 @@ lib /DEF:"$(ProjectDir)signal_processing_f_Import.def" /SUBSYSTEM:WINDOWS /MACHI
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../output_stream/includes;../../../localization/includes;../../../dynamic_link/includes;../../../string/includes;../../../core/includes;../../../../libs/intl;../../../statistics/includes;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/MALLOC/includes;../../../output_stream/includes;../../../localization/includes;../../../dynamic_link/includes;../../../string/includes;../../../core/includes;../../../../libs/intl;../../../statistics/includes;../../../api_scilab/includes;../../../operations/includes;../../../types/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;SIGNAL_PROCESSING_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -215,7 +215,7 @@ lib /DEF:"$(ProjectDir)signal_processing_f_Import.def" /SUBSYSTEM:WINDOWS /MACHI
 </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>LibScilab.lib;signal_processing_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>LibScilab.lib;signal_processing_f.lib;../../../../bin/elementary_functions_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ModuleDefinitionFile>
       </ModuleDefinitionFile>
@@ -234,16 +234,11 @@ lib /DEF:"$(ProjectDir)signal_processing_f_Import.def" /SUBSYSTEM:WINDOWS /MACHI
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\sci_gateway\c\sci_remez.c" />
     <ClCompile Include="corrtable.c" />
     <ClCompile Include="DllmainSignal_processing.c" />
     <ClCompile Include="..\..\sci_gateway\c\gw_signal.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_amell.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_corr.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_delip.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_fft.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_remez.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_rpem.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_syredi.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_signal_processing.h" />
index 8fd9e18..e94b5c5 100644 (file)
     <ClCompile Include="..\..\sci_gateway\c\sci_amell.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_corr.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_delip.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_fft.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_remez.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_rpem.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_syredi.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_signal_processing.h">
index 6c7c2da..133ab11 100644 (file)
@@ -1,9 +1,11 @@
-// =============================================================================
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO
+// Copyright (C) 2011 - DIGITEO
 //
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
+// 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
 
 a=amell(10,0.1);
 if a > 3.693 then pause,end
index 4162145..eb642d2 100644 (file)
@@ -1,5 +1,3 @@
-// -*- scilab -*-
-
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) 2008 - Digiteo - unknown author
 // Copyright (C) 2009 - Digiteo - Vincent LIARD
@@ -10,22 +8,7 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
-// 'corr' unit tests
-
-test_path = pathconvert(SCI + '/modules/signal_processing/tests/unit_tests');
-
-// requires test_utilities.sci
-exec(test_path + 'test_utilities.sci');
-
-// ****************************************************************
-// * Part I: defining the tests                                   *
-// * Part II: performing the tests                                *
-// ****************************************************************
-
-// **** Part I: defining the tests ****
-
-// old tests wrapped
-function test_corr_old() 
+test_path = SCI + "/modules/signal_processing/tests/unit_tests/";
 rand('normal');
 x = rand(1,256);
 y = -x;
@@ -37,8 +20,12 @@ y = y-mxy(2)*ones(y);
 c1 = corr(x,y,32);
 c2 = corr(x,32);
 if norm(c1+c2,1) > %eps then pause,end
-deff('[z]=xx(inc,is)','z=x(is:is+inc-1)');
-deff('[z]=yy(inc,is)','z=y(is:is+inc-1)');
+function z = xx(inc, is)
+    z = x(is:is+inc-1);
+endfunction
+function z = yy(inc, is)
+    z=y(is:is+inc-1);
+endfunction
 [c3,m3]=corr('fft',xx,yy,256,32);
 if norm(c1-c3,1) > 10 *%eps then pause,end
 [c4,m4]=corr('fft',xx,256,32);
@@ -48,10 +35,8 @@ if norm(m3,1) > %eps then pause,end
 if norm(m4,1) > %eps then pause,end
 if norm(c3-c1,1) > 10*%eps then pause,end
 if norm(c4-c2,1) > 10*%eps then pause,end
-endfunction
 
 // corr default mode
-function test_corr_default()
 x = [1:10];
 y = [5 10 6 4 8 2 9 3 1 7];
 nlags = 3;
@@ -59,66 +44,50 @@ nlags = 3;
 cov_ref1 = [8.25 5.775 3.4];
 Mean_ref1 = 5.5;
 cov = corr(x, nlags);
-check(cov, cov_ref1);
+if cov <> cov_ref1 then pause,end
+
 [cov, Mean] = corr(x, nlags);
-check([cov, Mean], [cov_ref1, Mean_ref1]);
+if or([cov, Mean] <> [cov_ref1, Mean_ref1]) then pause,end
 // x, y, nlag provided
 cov_ref2 = [-2.55 -2.825 -0.4];
 Mean_ref2 = [5.5 5.5];
 cov = corr(x, y, nlags);
-check(cov, cov_ref2);
+if cov <> cov_ref2 then pause,end
 [cov, Mean] = corr(x, y, nlags);
-check([cov, Mean], [cov_ref2, Mean_ref2]);
-endfunction
+if or([cov, Mean] <> [cov_ref2, Mean_ref2]) then pause,end
 
 // corr updates mode
-function test_corr_updates()
-load(test_path + 'corr_updates_ref.dat',..
-    'w1_ref', 'xu1_ref', 'w2_ref', 'xu2_ref', 'w3_ref', 'xu3_ref',..
-    'w4_ref', 'xu4_ref', 'w5_ref', 'xu5_ref', 'w6_ref', 'xu6_ref',..
-    'w7_ref', 'xu7_ref', 'w8_ref', 'xu8_ref', 'w9_ref', 'xu9_ref');
+import_from_hdf5(test_path + 'corr_updates_ref.h5');
 [w1,xu1] = corr('updt', [1:10], zeros(1,8));
-check([w1, xu1], [w1_ref, xu1_ref]);
+if or([w1, xu1] <> [w1_ref, xu1_ref]) then pause,end
 [w2, xu2] = corr('updt', [1:8], [%i %i %i %i]);
-check([w2, xu2], [w2_ref, xu2_ref]);
+of or([w2, xu2] <> [w2_ref, xu2_ref]) then pause,end
 [w3, xu3] = corr('updt', [1:8], [1:8], zeros(1,8));
-check([w3, xu3], [w3_ref, xu3_ref]);
+if or([w3, xu3] <> [w3_ref, xu3_ref]) then pause,end
 [w4, xu4] = corr('updt', [1:10], [1:10],zeros(1,8));
-check([w4, xu4], [w4_ref, xu4_ref]);
+if or([w4, xu4] <> [w4_ref, xu4_ref]) then pause,end
 [w5, xu5] = corr('updt', [1:10], [1:10],ones(1,8));
-check([w5, xu5], [w5_ref, xu5_ref]);
+if or([w5, xu5] <> [w5_ref, xu5_ref]) then pause,end
 [w6, xu6] = corr('updt', [1:10], [5 10 6 4 8 2 9 3 1 7], zeros(1,8));
-check([w6, xu6], [w6_ref, xu6_ref]);
+if or([w6, xu6] <> [w6_ref, xu6_ref]) then pause,end
 [w7, xu7] = corr('updt', [1:8], [1:8], zeros(1,8), zeros(1,8));
-check([w7, xu7], [w7_ref, xu7_ref]);
+if or([w7, xu7] <> [w7_ref, xu7_ref]) then pause,end
 [w8, xu8] = corr('updt', [1:8], [1:8], zeros(1,8), 0);
-check([w8, xu8], [w8_ref, xu8_ref]);
+if or([w8, xu8] <> [w8_ref, xu8_ref]) then pause,end
 [w9, xu9] = corr('updt', [1:8], [1:8], zeros(1,8), [5 2 6 5 3 7 4 5]);
-check([w9, xu9], [w9_ref, xu9_ref]);
-endfunction
+if or([w9, xu9] <> [w9_ref, xu9_ref]) then pause,end
 
 // corr fft mode
-function test_corr_fft()
-load(test_path + 'corr_fft_ref.dat',..
-    'x', 'c1_ref', 'm1_ref', 'c2_ref', 'm2_ref');
-// x = rand(1,64);
+import_from_hdf5(test_path + 'corr_fft_ref.h5');
 y = -x;
-deff('[z]=xx(inc,is)', 'z=x(is:is+inc-1)');
-deff('[z]=yy(inc,is)', 'z=y(is:is+inc-1)');
-[c1, m1] = corr('fft', xx, 64, 4);
-check([c1, m1], [c1_ref, m1_ref]);
-[c2, m2] = corr('fft', xx, yy, 64, 4);
-check([c2, m2], [c2_ref, m2_ref]);
+function z = xx(inc, is)
+    z = x(is:is+inc-1)
 endfunction
-
-// **** Part II: performing the tests ****
-
-// wrap all tests together
-function test_corr()
-test_corr_old();
-test_corr_default();
-test_corr_updates();
-test_corr_fft();
+function z = yy(inc,is)
+    z = y(is:is+inc-1)
 endfunction
 
-test_corr();
+[c1, m1] = corr('fft', xx, 64, 4);
+if or([c1, m1] <> [c1_ref, m1_ref]) then pause,end
+[c2, m2] = corr('fft', xx, yy, 64, 4);
+if or([c2, m2] <> [c2_ref, m2_ref]) then pause,end
diff --git a/scilab/modules/signal_processing/tests/unit_tests/corr_fft_ref.dat b/scilab/modules/signal_processing/tests/unit_tests/corr_fft_ref.dat
deleted file mode 100644 (file)
index bd8c6ad..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/corr_fft_ref.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/corr_fft_ref.h5 b/scilab/modules/signal_processing/tests/unit_tests/corr_fft_ref.h5
new file mode 100644 (file)
index 0000000..4dc4491
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/corr_fft_ref.h5 differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/corr_updates_ref.dat b/scilab/modules/signal_processing/tests/unit_tests/corr_updates_ref.dat
deleted file mode 100644 (file)
index ea4922e..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/corr_updates_ref.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/corr_updates_ref.h5 b/scilab/modules/signal_processing/tests/unit_tests/corr_updates_ref.h5
new file mode 100644 (file)
index 0000000..4b9c433
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/corr_updates_ref.h5 differ
index 403c1e6..8787040 100644 (file)
@@ -5,8 +5,7 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 
-ck=0.5;
-r = delip([1,2],ck);
+r = delip([1,2], 0.5);
 ref = [1.6857504    1.6857504 + 2.1565156*%i];
 if or(size(r)<> [1 2]) then pause,end
 if norm(ref-r) > 1e9 *%eps then pause,end
index 43e4a2c..96e03f1 100644 (file)
@@ -1,5 +1,3 @@
-// -*- scilab -*-
-
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 // Copyright (C) 2008 - Digiteo - unknown author
 // Copyright (C) 2009 - Digiteo - Vincent LIARD
@@ -10,25 +8,9 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
-// 'fft' unit tests
-
-test_path = pathconvert(SCI + '/modules/signal_processing/tests/unit_tests');
-
-// requires test_utilities.sci
-exec(test_path + 'test_utilities.sci');
-
-// ****************************************************************
-// * Part I: defining the tests                                   *
-// * Part II: performing the tests                                *
-// ****************************************************************
-
-// **** Part I: defining the tests ****
-
-// old tests wrapped
-function test_fft_old()
 a = [1;2;3];
 n=size(a,'*');
-r1 = norm(1/n*exp(2*%i*%pi*(0:n-1)'.*.(0:n-1)/n)*a -fft(a,1));
+r1 = norm(1/n*exp(2*%i*%pi*(0:n-1)'.*.(0:n-1)/n)*a -fft([1;2;3],1));
 if r1 > 10 *%eps then pause,end
 r2 = norm(exp(-2*%i*%pi*(0:n-1)'.*.(0:n-1)/n)*a -fft(a,-1));
 if r2 > 100 *%eps then pause,end
@@ -37,53 +19,5 @@ t = 0:1/sample_rate:0.6;
 N = size(t,'*');
 s = sin(2*%pi*50*t)+sin(2*%pi*70*t+%pi/4)+grand(1,N,'nor',0,1);
 y = fft(s);
-if or(size(y) <> [1 601]) then pause,end
-endfunction
-
-function test_fft_1d()
-// TODO: add checks for reverse fft
-load(test_path + 'fft_1dim.dat', 'y_ref');
-a = [1 2 3 4 5 6 7 8 9 10 11 12];
-check(fft(a), y_ref);
-endfunction
-
-function test_fft_2d()
-// TODO: add checks for reverse fft
-load(test_path + 'fft_2dim.dat', 'y1_ref', 'y2_ref', 'y3_ref', 'y4_ref');
-// rows number and cols number power of 2
-a1 = [1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 16];
-check(y1_ref, fft(a1));
-// rows number power of 2
-a2 = [1 2 3;4 5 6;7 8 9;10 11 12];
-check(y2_ref, fft(a2));
-// cols number power of 2
-a3 = [1 2 3 4;5 6 7 8;9 10 11 12];
-check(y3_ref, fft(a3));
-// neither rows nor cols power of 2
-a4 = [1 2 3;4 5 6;7 8 9];
-check(y4_ref, fft(a4));
-endfunction
-
-function test_fft_ndim()
-// these tests may be improperly tailored...
-// TODO: add tests for forward fft
-load(test_path + 'fft_ndim.dat', 'y1_ref', 'y2_ref', 'y3_ref');
-a1 = [1 2 3 4 5 6 7 8 9 10 11 12];
-check(y1_ref, fft(a1, -1, 3, 2));
-a2 = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30];
-check(y2_ref, fft(a2, -1, [2 3 5], [1 2 6]));
-a3 = [1 2 3 4 5 6 7 8 9];
-check(y3_ref, fft(a3,-1,[3 3],[1 3]));
-endfunction
-
-// **** Part II: performing the tests ****
-
-// wrap all tests together
-function test_fft()
-test_fft_old();
-test_fft_1d();
-test_fft_2d();
-test_fft_ndim();
-endfunction
+if size(y) <> [1 601] then pause,end
 
-test_fft();
diff --git a/scilab/modules/signal_processing/tests/unit_tests/fft_1dim.dat b/scilab/modules/signal_processing/tests/unit_tests/fft_1dim.dat
deleted file mode 100644 (file)
index bec18a1..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/fft_1dim.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/fft_1dim.h5 b/scilab/modules/signal_processing/tests/unit_tests/fft_1dim.h5
new file mode 100644 (file)
index 0000000..37bc494
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/fft_1dim.h5 differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/fft_2dim.dat b/scilab/modules/signal_processing/tests/unit_tests/fft_2dim.dat
deleted file mode 100644 (file)
index 5b316a8..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/fft_2dim.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/fft_2dim.h5 b/scilab/modules/signal_processing/tests/unit_tests/fft_2dim.h5
new file mode 100644 (file)
index 0000000..042c67f
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/fft_2dim.h5 differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/fft_ndim.dat b/scilab/modules/signal_processing/tests/unit_tests/fft_ndim.dat
deleted file mode 100644 (file)
index e4d3eb3..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/fft_ndim.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/fft_ndim.h5 b/scilab/modules/signal_processing/tests/unit_tests/fft_ndim.h5
new file mode 100644 (file)
index 0000000..3735041
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/fft_ndim.h5 differ
index 603662c..7f98a90 100644 (file)
@@ -1,12 +1,52 @@
+
 // =============================================================================
+
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+
 // Copyright (C) 2009 - DIGITEO
+
+// Copyright (C) 2010 - DIGITEO
+
 //
+
 //  This file is distributed under the same license as the Scilab package.
+
 // =============================================================================
+
 iext = linspace(1,5,5);
+
 ds = [ones(1:5),zeros(1:5)];
+
 fg = linspace(0,0.5,10);
+
 wt = ones(fg);
+
 y = remez(iext,ds,fg,wt);
+
 if max(abs(y - [0.500 0.852 0.000 0.000])) > 0.001 then bugmes();quit;end
+
+nc=21;
+
+ngrid=nc*250;
+
+fgrid=.5*(0:(ngrid-1))/(ngrid-1);
+
+mag=ones(1:ngrid/2);
+
+mag(ngrid/2+1:ngrid)=0*ones(1:ngrid/2);
+
+weight=ones(fgrid);
+
+guess=round(1:ngrid/nc:ngrid);
+
+guess(nc+1)=ngrid;
+
+guess(nc+2)=ngrid;
+
+an=remez(guess,mag,fgrid,weight);
+************ failure to converge **********
+probable cause is machine rounding error
+- number of iterations =   5
+if the number of iterations exceeds 3 the design
+may be correct, but should be verified with an fft
+
index d85610b..0aafdcd 100644 (file)
@@ -1,10 +1,11 @@
-// =============================================================================
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - DIGITEO
-// Copyright (C) 2010 - DIGITEO
+// Copyright (C) 2011 - DIGITEO
 //
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
+// 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
 
 iext = linspace(1,5,5);
 ds = [ones(1:5),zeros(1:5)];
@@ -18,10 +19,10 @@ if max(abs(y - [0.500 0.852 0.000 0.000])) > 0.001 then pause, end
 nc=21;
 ngrid=nc*250;
 fgrid=.5*(0:(ngrid-1))/(ngrid-1);
-mag(1:ngrid/2)=ones(1:ngrid/2);
+mag=ones(1:ngrid/2);
 mag(ngrid/2+1:ngrid)=0*ones(1:ngrid/2);
 weight=ones(fgrid);
 guess=round(1:ngrid/nc:ngrid);
 guess(nc+1)=ngrid;
 guess(nc+2)=ngrid;
-an=remez(guess,mag,fgrid,weight);
\ No newline at end of file
+an=remez(guess,mag,fgrid,weight);
index fac86f9..d1fb4f0 100644 (file)
+
 // -*- scilab -*-
+
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+
 // Copyright (C) 2009 - Digiteo - Vincent Liard
+
 //
+
 // 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
+
 // 'rpem' unit tests
+
 test_path = pathconvert(SCI + '/modules/signal_processing/tests/unit_tests');
+
 // requires test_utilities.sci
+
+exec(test_path + 'test_utilities.sci');
+
 n = 2;
-theta=zeros(1,3*n);
-p=eye(3*n,3*n);
-phi=theta;
-psi=theta;
-l=theta;
-w0=list(theta, p, l, phi, psi);
-u0=[1 2 3 4];
-y0=[5 2 7 3];
-lambda=[1 1 1];
-kappa=[1 1 1];
-c=500;
+
+theta = zeros(1,3*n);
+
+p = eye(3*n,3*n);
+
+phi = theta;
+
+psi = theta;
+
+l = theta;
+
+w0 = list(theta, p, l, phi, psi);
+
+u0 = [1 2 3 4];
+
+y0 = [5 2 7 3];
+
+lambda = [1 1 1];
+
+kappa = [1 1 1];
+
+c = 500;
+
 // test 1 ****************************************************************
-load(test_path + 'rpem_ref1.dat', 'w1_ref1', 'v_ref1');
+
+//load(test_path + 'rpem_ref1.dat', 'w1_ref1', 'v_ref1');
+
+import_from_hdf5(test_path+"rpem_ref1.h5");
+
 check(rpem(w0, u0, y0), w1_ref1);
+
 [w1,v] = rpem(w0, u0, y0);
+
 check(w1, w1_ref1);
+
 check(v, v_ref1);
+
 // test 2 ****************************************************************
-load(test_path + 'rpem_ref2.dat', 'w1_ref2', 'v_ref2');
+
+//load(test_path + 'rpem_ref2.dat', 'w1_ref2', 'v_ref2');
+
+import_from_hdf5(test_path+"rpem_ref2.h5");
+
 check(rpem(w0, u0, y0, lambda), w1_ref2);
+
 [w1,v] = rpem(w0, u0, y0, lambda);
+
 check(w1, w1_ref2);
+
 check(v, v_ref2);
+
 // test 3 ****************************************************************
-load(test_path + 'rpem_ref3.dat', 'w1_ref3', 'v_ref3');
+
+//load(test_path + 'rpem_ref3.dat', 'w1_ref3', 'v_ref3');
+
+import_from_hdf5(test_path+"rpem_ref3.h5");
+
 check(rpem(w0, u0, y0, lambda, kappa), w1_ref3);
+
 [w1,v] = rpem(w0, u0, y0, lambda, kappa);
+
 check(w1, w1_ref3);
+
 check(v, v_ref3);
+
 // test 4 ****************************************************************
-load(test_path + 'rpem_ref4.dat', 'w1_ref4', 'v_ref4');
+
+//load(test_path + 'rpem_ref4.dat', 'w1_ref4', 'v_ref4');
+
+import_from_hdf5(test_path+"rpem_ref4.h5");
+
 check(rpem(w0, u0, y0, lambda, kappa, c), w1_ref4);
+
 [w1,v] = rpem(w0, u0, y0, lambda, kappa, c);
+
 check(w1, w1_ref4);
+
 check(v, v_ref4);
+
 //****************************************************************
+
index 3890c5f..74ba24c 100644 (file)
@@ -1,7 +1,5 @@
-// -*- scilab -*-
-
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - Digiteo - Vincent Liard
+// Copyright (C) 2011 - DIGITEO
 //
 // This file must be used under the terms of the CeCILL.
 // This source file is licensed as described in the file COPYING, which
@@ -9,12 +7,7 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
-// 'rpem' unit tests
-
-test_path = pathconvert(SCI + '/modules/signal_processing/tests/unit_tests');
-
-// requires test_utilities.sci
-exec(test_path + 'test_utilities.sci');
+test_path = SCI + '/modules/signal_processing/tests/unit_tests/';
 
 n = 2;
 theta = zeros(1,3*n);
@@ -29,36 +22,34 @@ lambda = [1 1 1];
 kappa = [1 1 1];
 c = 500;
 
-// test 1 ****************************************************************
-load(test_path + 'rpem_ref1.dat', 'w1_ref1', 'v_ref1');
-
-check(rpem(w0, u0, y0), w1_ref1);
-
+import_from_hdf5(test_path + "rpem_ref1.h5");
+w1 = rpem(w0, u0, y0);
+if w1 <> w1_ref then pause, end
 [w1,v] = rpem(w0, u0, y0);
-check(w1, w1_ref1);
-check(v, v_ref1);
-// test 2 ****************************************************************
-load(test_path + 'rpem_ref2.dat', 'w1_ref2', 'v_ref2');
+if w1 <> w1_ref1 then pause, end
+if v <> v_ref1 then pause, end
 
-check(rpem(w0, u0, y0, lambda), w1_ref2);
+import_from_hdf5(test_path + "rpem_ref2.h5");
+w1 = rpem(w0, u0, y0, lambda);
+if w1 <> w1_ref2 then pause, end
 
 [w1,v] = rpem(w0, u0, y0, lambda);
-check(w1, w1_ref2);
-check(v, v_ref2);
-// test 3 ****************************************************************
-load(test_path + 'rpem_ref3.dat', 'w1_ref3', 'v_ref3');
+if w1 <> w1_ref2 then pause, end
+if v <> v_ref2 then pause, end
+
+import_from_hdf5(test_path + "rpem_ref3.h5");
 
-check(rpem(w0, u0, y0, lambda, kappa), w1_ref3);
+w1 = rpem(w0, u0, y0, lambda, kappa);
+if w1 <> w1_ref3 then pause, end
 
 [w1,v] = rpem(w0, u0, y0, lambda, kappa);
-check(w1, w1_ref3);
-check(v, v_ref3);
-// test 4 ****************************************************************
-load(test_path + 'rpem_ref4.dat', 'w1_ref4', 'v_ref4');
+if w1 <> w1_ref3 then pause, end
+if v <> v_ref3 then pause, end
 
-check(rpem(w0, u0, y0, lambda, kappa, c), w1_ref4);
+import_from_hdf5(test_path + "rpem_ref4.h5");
+w1 = rpem(w0, u0, y0, lambda, kappa, c);
+if w1 <> w1_ref4 then pause, end
 
 [w1,v] = rpem(w0, u0, y0, lambda, kappa, c);
-check(w1, w1_ref4);
-check(v, v_ref4);
-//****************************************************************
+if w1 <> w1_ref4 then pause, end
+if v <> v_ref4 then pause, end
diff --git a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref1.dat b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref1.dat
deleted file mode 100644 (file)
index 021d449..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref1.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref1.h5 b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref1.h5
new file mode 100644 (file)
index 0000000..5751e33
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref1.h5 differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref2.dat b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref2.dat
deleted file mode 100644 (file)
index bff9aea..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref2.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref2.h5 b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref2.h5
new file mode 100644 (file)
index 0000000..633b55f
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref2.h5 differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref3.dat b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref3.dat
deleted file mode 100644 (file)
index 6ac4635..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref3.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref3.h5 b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref3.h5
new file mode 100644 (file)
index 0000000..4fff084
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref3.h5 differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref4.dat b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref4.dat
deleted file mode 100644 (file)
index 0f7ea1a..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref4.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/rpem_ref4.h5 b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref4.h5
new file mode 100644 (file)
index 0000000..01a7bbd
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/rpem_ref4.h5 differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/syredi.dat b/scilab/modules/signal_processing/tests/unit_tests/syredi.dat
deleted file mode 100644 (file)
index a905129..0000000
Binary files a/scilab/modules/signal_processing/tests/unit_tests/syredi.dat and /dev/null differ
diff --git a/scilab/modules/signal_processing/tests/unit_tests/syredi.h5 b/scilab/modules/signal_processing/tests/unit_tests/syredi.h5
new file mode 100644 (file)
index 0000000..c3f32b8
Binary files /dev/null and b/scilab/modules/signal_processing/tests/unit_tests/syredi.h5 differ
index e6efbe6..5f5e4f8 100644 (file)
@@ -1,27 +1,14 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO
+//
 // 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
+// are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
-// 'syredi' unit tests
+test_path = SCI + '/modules/signal_processing/tests/unit_tests/';
 
-test_path = pathconvert(SCI + '/modules/signal_processing/tests/unit_tests');
-
-// requires test_utilities.sci
-exec(test_path + 'test_utilities.sci');
-
-// ****************************************************************
-// * Part I: defining the tests                                   *
-// * Part II: performing the tests                                *
-// ****************************************************************
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-
-// **** Part I: defining the tests ****
-
-// old tests wrapped
-function test_syredi_old()
 [fact,b2,b1,b0,c1,c0,zzeros,zpoles]=syredi(1,4,[2*%pi/10,4*%pi/10,0,0],0.02,0.001);
 ref_fact = 0.005976;
 if norm(fact-ref_fact) > 0.0000037 then pause,end;
@@ -34,22 +21,25 @@ if or(size(c0)<>[1 3]) then pause,end;
 if c0(3)<> 0 then pause,end;
 if or(size(zzeros)<>[1 5]) then pause,end;
 if or(size(zpoles)<>[1 5]) then pause,end;
-endfunction
 
-function test_syredi_new()
-load(test_path + 'syredi.dat', 'fact1_ref', 'b21_ref', 'b11_ref', 'b01_ref', 'c11_ref', 'c01_ref', 'zzeros1_ref', 'zpoles1_ref', 'fact2_ref', 'b22_ref', 'b12_ref', 'b02_ref', 'c12_ref', 'c02_ref', 'zzeros2_ref', 'zpoles2_ref');
+import_from_hdf5(test_path+"syredi.h5");
 [fact1, b21, b11, b01, c11, c01, zzeros1, zpoles1] = syredi(1, 4, [1, 2, 0, 0], 0.02, 0.001);
-check(list(fact1, b21, b11, b01, c11, c01, zzeros1, zpoles1), list(fact1_ref,b21_ref,b11_ref,b01_ref,c11_ref,c01_ref,zzeros1_ref,zpoles1_ref));
-[fact2, b22, b12, b02, c12, c02, zzeros2, zpoles2] = syredi(3, 4, [1, 2, 3, 3.01], 0.1, 0.001);
-check(list(fact2, b22, b12, b02, c12, c02, zzeros2, zpoles2), list(fact2_ref,b22_ref,b12_ref,b02_ref,c12_ref,c02_ref,zzeros2_ref,zpoles2_ref));
-endfunction
-
-// **** Part II: performing the tests ****
+if fact1 <> fact1_ref then pause, end
+if b21 <> b21_ref then pause, end
+if b11 <> b11_ref then pause, end
+if b01 <> b01_ref then pause, end
+if c11 <> c11_ref then pause, end
+if c01 <> c01_ref then pause, end
+if zzeros1 <> zzeros1_ref then pause, end
+if zpoles1 <> zpoles1_ref then pause, end
 
-// wrap all tests together
-function test_syredi()
-test_syredi_old();
-test_syredi_new();
-endfunction
+[fact2, b22, b12, b02, c12, c02, zzeros2, zpoles2] = syredi(3, 4, [1, 2, 3, 3.01], 0.1, 0.001);
+if fact2 <> fact2_ref then pause, end
+if b22 <> b22_ref then pause, end
+if b12 <> b12_ref then pause, end
+if b02 <> b02_ref then pause, end
+if c12 <> c12_ref then pause, end
+if c02 <> c02_ref then pause, end
+if zzeros2 <> zzeros2_ref then pause, end
+if zpoles2 <> zpoles2_ref then pause, end
 
-test_syredi();
diff --git a/scilab/modules/signal_processing/tests/unit_tests/test_utilities.sci b/scilab/modules/signal_processing/tests/unit_tests/test_utilities.sci
deleted file mode 100644 (file)
index 9f39269..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - Digiteo - Vincent Liard
-//
-// 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
-
-// RPEM unit tests
-
-// substraction on lists (for lists whose elements allow the minus operator)
-function r=list_substract(l1,l2)
-r = list();
-for i=1:length(l1)
-  r(i) = l1(i) - l2(i);
-end
-endfunction
-
-// overload minus operator for lists
-deff('x = %l_s_l(l1,l2)', 'x = list_substract(l1,l2)');
-
-// absolute value on lists
-function r=list_abs(l)
-r=list()
-for i=1:length(l)
-  r(i) = abs(l(i))
-end
-endfunction
-
-// overload absolute value on lists
-deff('y = %l_abs(x)', 'y = list_abs(x)');
-
-// overall maximum on structured objects
-// list(list(1,2,3),list(2,list(7,11),4)) -> 11
-// [4,[[7,[11,3,[1,[20],[]],2]],2]] -> 20
-function m=list_max(l)
-m=-%inf
-if typeof(l) == 'constant' then
-  m = max(l)
-else
-  for e=l
-    m = max(list_max(e), m)
-  end
-end
-endfunction
-
-// unfortunately, max can't be overloaded on lists
-// (since list max is already hardwrired)
-
-// check whether objects a and b differ from less than 2*epsilon
-// (error on a and b: eps => error on a-b: 2eps)
-// (works on any list-matrix combination)
-// epsilon defaults to %eps if not provided by calling sequence
-function r=match(a,b,epsilon)
-if ~isdef('epsilon') then
-  epsilon = %eps;
-end
-r = (list_max(abs(a-b)) <= 2*epsilon);
-endfunction
-
-// because of test mechanism restrictions...
-if ~isdef('bugmes') then
-  function bugmes()
-  pause
-  endfunction
-end
-
-// compare objects a and b, pause if differ from more than epsilon
-// epsilon defaults to %eps if not provided by calling sequence
-// would better rely on match's default epsilon but I lack inspiration in this thursday's early afternoon
-function check(a,b,epsilon)
-if ~isdef('epsilon') then
-  epsilon = %eps;
-end
-if ~match(a,b,epsilon) then
-  bugmes();
-end
-endfunction
index 337d2b5..384e5e7 100644 (file)
     <ClInclude Include="..\includes\macro.hxx" />
     <ClInclude Include="..\includes\macrofile.hxx" />
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\system_env\system_env.vcxproj">
+      <Project>{7ca60aef-9afa-4d06-af28-613c0aa27640}</Project>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>