linear_algebra plugged. 03/4803/5
Cedric Delamarre [Wed, 31 Aug 2011 15:50:47 +0000 (17:50 +0200)]
Change-Id: I94ed8e39b145fb3f085e9640b671e896c5cac675

77 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/boolean/Makefile.am
scilab/modules/boolean/Makefile.in
scilab/modules/boolean/includes/boolean_gw.hxx
scilab/modules/boolean/sci_gateway/cpp/sci_bool2s.cpp [new file with mode: 0644]
scilab/modules/boolean/src/cpp/boolean_gw.cpp
scilab/modules/boolean/src/cpp/boolean_gw.vcxproj
scilab/modules/boolean/src/cpp/boolean_gw.vcxproj.filters
scilab/modules/cacsd/Makefile.am
scilab/modules/cacsd/Makefile.in
scilab/modules/cacsd/includes/gw_cacsd0.h
scilab/modules/cacsd/sci_gateway/c/gw_cacsd0.c
scilab/modules/elementary_functions/sci_gateway/cpp/elem_func_gw.cpp
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/history_manager/Makefile.am
scilab/modules/linear_algebra/Makefile.am
scilab/modules/linear_algebra/Makefile.in
scilab/modules/linear_algebra/includes/balanc.h
scilab/modules/linear_algebra/includes/chol.h
scilab/modules/linear_algebra/includes/det.h
scilab/modules/linear_algebra/includes/dynlib_linear_algebra_gw.h [new file with mode: 0644]
scilab/modules/linear_algebra/includes/eigen.h
scilab/modules/linear_algebra/includes/gw_linear_algebra.h
scilab/modules/linear_algebra/includes/hess.h
scilab/modules/linear_algebra/includes/invert_matrix.h
scilab/modules/linear_algebra/includes/linear_algebra_gw.hxx [new file with mode: 0644]
scilab/modules/linear_algebra/includes/lsq.h
scilab/modules/linear_algebra/includes/lu.h
scilab/modules/linear_algebra/includes/qr.h
scilab/modules/linear_algebra/includes/rcond.h
scilab/modules/linear_algebra/includes/svd.h
scilab/modules/linear_algebra/linear_algebra.iss
scilab/modules/linear_algebra/sci_gateway/c/gw_linear_algebra.c
scilab/modules/linear_algebra/sci_gateway/c/gw_linear_algebra2.c
scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj.filters [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_balanc.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_bdiag.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_chol.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_det.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_hess.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_inv.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_lsq.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_lu.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_qr.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_rcond.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_schur.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_spec.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/sci_gateway/cpp/sci_svd.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/src/c/eigen.c
scilab/modules/linear_algebra/src/c/invert_matrix.c
scilab/modules/linear_algebra/src/c/linear_algebra.vcxproj
scilab/modules/linear_algebra/src/c/linear_algebra.vcxproj.filters
scilab/modules/linear_algebra/src/c/qr.c
scilab/modules/linear_algebra/src/c/rcond.c
scilab/modules/linear_algebra/src/c/svd.c
scilab/modules/linear_algebra/src/cpp/schurSelect.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/src/cpp/schurSelect.h [new file with mode: 0644]
scilab/modules/linear_algebra/src/cpp/scischur.cpp [new file with mode: 0644]
scilab/modules/linear_algebra/src/cpp/scischur.h [new file with mode: 0644]
scilab/modules/linear_algebra/tests/unit_tests/bdiag.dia.ref
scilab/modules/linear_algebra/tests/unit_tests/bdiag.tst
scilab/modules/linear_algebra/tests/unit_tests/lu.dia.ref
scilab/modules/linear_algebra/tests/unit_tests/lu.tst
scilab/modules/linear_algebra/tests/unit_tests/schur.dia.ref
scilab/modules/linear_algebra/tests/unit_tests/schur.tst
scilab/modules/linear_algebra/tests/unit_tests/squeeze.tst
scilab/modules/linear_algebra/tests/unit_tests/svd.dia.ref
scilab/modules/operations/src/c/matrix_division.c
scilab/modules/system_env/includes/configvariable.hxx
scilab/modules/system_env/src/cpp/configvariable.cpp

index 664a364..d18d639 100644 (file)
@@ -654,6 +654,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "signal_processing_gw", "mod
                {959384FC-016C-4B01-B848-1B18D26B6CC4} = {959384FC-016C-4B01-B848-1B18D26B6CC4}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "linear_algebra_gw", "modules\linear_algebra\sci_gateway\cpp\linear_algebra_gw.vcxproj", "{EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -2082,6 +2084,14 @@ Global
                {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
+               {EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}.Debug|Win32.ActiveCfg = Debug|Win32
+               {EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}.Debug|Win32.Build.0 = Debug|Win32
+               {EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}.Debug|x64.ActiveCfg = Debug|x64
+               {EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}.Debug|x64.Build.0 = Debug|x64
+               {EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}.Release|Win32.ActiveCfg = Release|Win32
+               {EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}.Release|Win32.Build.0 = Release|Win32
+               {EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}.Release|x64.ActiveCfg = Release|x64
+               {EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 5c98aa1..60ccd3e 100644 (file)
@@ -44,5 +44,6 @@
     <module name="console" activate="yes"/>
     <module name="modules_manager" activate="yes"/>
     <module name="signal_processing" activate="yes"/>
+    <module name="linear_algebra" activate="yes"/>
 </modules>
 
index 64efaa1..96f7194 100644 (file)
@@ -45,5 +45,6 @@
     <module name="console" activate="yes"/>
     <module name="modules_manager" activate="yes"/>
     <module name="signal_processing" activate="yes"/>
+    <module name="linear_algebra" activate="yes"/>
 </modules>
 
index 0bf0e6e..0d348b4 100644 (file)
@@ -18,6 +18,8 @@
 #include "double.hxx"
 #include "polynom.hxx"
 #include "function.hxx"
+#include "double.hxx"
+#include "polynom.hxx"
 
 extern "C"
 {
@@ -308,7 +310,6 @@ int isVarComplex(void* _pvCtx, int* _piAddress)
         return 0;
     }
 
-
     getVarType(_pvCtx, _piAddress, &iType);
     switch(iType)
     {
index 1ec173e..8a5e18f 100644 (file)
@@ -6,42 +6,51 @@
 
 
 BOOLEAN_CPP_SOURCES = \
-       src/cpp/boolean_gw.cpp
+    src/cpp/boolean_gw.cpp
 
 
 
-BOOLEAN_C_SOURCES = src/c/matboolean.c \
-src/c/vect_or.c \
-src/c/vect_and.c
+BOOLEAN_C_SOURCES = \
+    src/c/matboolean.c \
+    src/c/vect_or.c \
+    src/c/vect_and.c
 
-BOOLEAN_FORTRAN_SOURCES = src/fortran/logic.f \
-src/fortran/find.f
+BOOLEAN_FORTRAN_SOURCES = \
+    src/fortran/logic.f \
+    src/fortran/find.f
 
-GATEWAY_C_SOURCES = sci_gateway/c/sci_and.c \
-sci_gateway/c/sci_or.c \
-sci_gateway/c/sci_find.c \
-sci_gateway/c/sci_bool2s.c \
-sci_gateway/c/gw_boolean.c
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/sci_bool2s.cpp
 
-GATEWAY_FORTRAN_SOURCES =  sci_gateway/fortran/sci_f_bool2s.f \
-sci_gateway/fortran/sci_f_find.f
+GATEWAY_C_SOURCES = \
+    sci_gateway/c/sci_and.c \
+    sci_gateway/c/sci_or.c \
+    sci_gateway/c/sci_find.c \
+    sci_gateway/c/sci_bool2s.c \
+    sci_gateway/c/gw_boolean.c
 
-libsciboolean_la_CFLAGS=       -I$(srcdir)/includes/ \
-                               -I$(srcdir)/src/c/ \
-                               -I$(top_srcdir)/modules/output_stream/includes \
-                               -I$(top_srcdir)/modules/api_scilab/includes \
-                               -I$(top_srcdir)/modules/operations/includes
+GATEWAY_FORTRAN_SOURCES = \
+    sci_gateway/fortran/sci_f_bool2s.f \
+    sci_gateway/fortran/sci_f_find.f
+
+libsciboolean_la_CFLAGS= \
+    -I$(srcdir)/includes/ \
+    -I$(srcdir)/src/c/ \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/operations/includes
 
 libsciboolean_la_CPPFLAGS = \
-       -I$(srcdir)/includes/ \
-       -I$(top_srcdir)/modules/functions_manager/includes \
-        -I$(top_srcdir)/modules/types/includes \
-        -I$(top_srcdir)/modules/symbol/includes \
-        -I$(top_srcdir)/modules/ast/includes \
-        -I$(top_srcdir)/modules/elementary_functions/includes \
-        -I$(top_srcdir)/modules/core/includes \
-        -I$(top_srcdir)/modules/operations/includes \
-        -I$(top_srcdir)/modules/api_scilab/includes
+    -I$(srcdir)/includes/ \
+    -I$(top_srcdir)/modules/functions_manager/includes \
+    -I$(top_srcdir)/modules/types/includes \
+    -I$(top_srcdir)/modules/symbol/includes \
+    -I$(top_srcdir)/modules/ast/includes \
+    -I$(top_srcdir)/modules/elementary_functions/includes \
+    -I$(top_srcdir)/modules/core/includes \
+    -I$(top_srcdir)/modules/operations/includes \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes
 
 
 
@@ -50,7 +59,7 @@ noinst_LTLIBRARIES = libsciboolean-algo.la
 
 libsciboolean_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
 
-libsciboolean_algo_la_SOURCES = $(BOOLEAN_C_SOURCES) $(BOOLEAN_FORTRAN_SOURCES) $(BOOLEAN_CPP_SOURCES)
+libsciboolean_algo_la_SOURCES = $(BOOLEAN_C_SOURCES) $(BOOLEAN_FORTRAN_SOURCES) $(BOOLEAN_CPP_SOURCES) $(GATEWAY_CPP_SOURCES)
 libsciboolean_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
 libsciboolean_algo_la_CFLAGS = $(libsciboolean_la_CFLAGS)
 libsciboolean_algo_la_CPPFLAGS = $(libsciboolean_la_CPPFLAGS)
index c0e1128..dfedfe4 100644 (file)
@@ -114,17 +114,18 @@ am__objects_1 = libsciboolean_algo_la-matboolean.lo \
        libsciboolean_algo_la-vect_and.lo
 am__objects_2 = logic.lo find.lo
 am__objects_3 = libsciboolean_algo_la-boolean_gw.lo
+am__objects_4 = libsciboolean_algo_la-sci_bool2s.lo
 am_libsciboolean_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
-       $(am__objects_3)
+       $(am__objects_3) $(am__objects_4)
 libsciboolean_algo_la_OBJECTS = $(am_libsciboolean_algo_la_OBJECTS)
 libsciboolean_la_DEPENDENCIES = libsciboolean-algo.la \
        $(top_builddir)/modules/arnoldi/libsciarnoldi.la \
        $(top_builddir)/modules/elementary_functions/libscielementary_functions.la
-am__objects_4 = libsciboolean_la-sci_and.lo libsciboolean_la-sci_or.lo \
+am__objects_5 = libsciboolean_la-sci_and.lo libsciboolean_la-sci_or.lo \
        libsciboolean_la-sci_find.lo libsciboolean_la-sci_bool2s.lo \
        libsciboolean_la-gw_boolean.lo
-am__objects_5 = sci_f_bool2s.lo sci_f_find.lo
-am_libsciboolean_la_OBJECTS = $(am__objects_4) $(am__objects_5)
+am__objects_6 = sci_f_bool2s.lo sci_f_find.lo
+am_libsciboolean_la_OBJECTS = $(am__objects_5) $(am__objects_6)
 libsciboolean_la_OBJECTS = $(am_libsciboolean_la_OBJECTS)
 libsciboolean_la_LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \
@@ -426,45 +427,54 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
 BOOLEAN_CPP_SOURCES = \
-       src/cpp/boolean_gw.cpp
-
-BOOLEAN_C_SOURCES = src/c/matboolean.c \
-src/c/vect_or.c \
-src/c/vect_and.c
-
-BOOLEAN_FORTRAN_SOURCES = src/fortran/logic.f \
-src/fortran/find.f
-
-GATEWAY_C_SOURCES = sci_gateway/c/sci_and.c \
-sci_gateway/c/sci_or.c \
-sci_gateway/c/sci_find.c \
-sci_gateway/c/sci_bool2s.c \
-sci_gateway/c/gw_boolean.c
-
-GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_bool2s.f \
-sci_gateway/fortran/sci_f_find.f
-
-libsciboolean_la_CFLAGS = -I$(srcdir)/includes/ \
-                               -I$(srcdir)/src/c/ \
-                               -I$(top_srcdir)/modules/output_stream/includes \
-                               -I$(top_srcdir)/modules/api_scilab/includes \
-                               -I$(top_srcdir)/modules/operations/includes
+    src/cpp/boolean_gw.cpp
+
+BOOLEAN_C_SOURCES = \
+    src/c/matboolean.c \
+    src/c/vect_or.c \
+    src/c/vect_and.c
+
+BOOLEAN_FORTRAN_SOURCES = \
+    src/fortran/logic.f \
+    src/fortran/find.f
+
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/sci_bool2s.cpp
+
+GATEWAY_C_SOURCES = \
+    sci_gateway/c/sci_and.c \
+    sci_gateway/c/sci_or.c \
+    sci_gateway/c/sci_find.c \
+    sci_gateway/c/sci_bool2s.c \
+    sci_gateway/c/gw_boolean.c
+
+GATEWAY_FORTRAN_SOURCES = \
+    sci_gateway/fortran/sci_f_bool2s.f \
+    sci_gateway/fortran/sci_f_find.f
+
+libsciboolean_la_CFLAGS = \
+    -I$(srcdir)/includes/ \
+    -I$(srcdir)/src/c/ \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/operations/includes
 
 libsciboolean_la_CPPFLAGS = \
-       -I$(srcdir)/includes/ \
-       -I$(top_srcdir)/modules/functions_manager/includes \
-        -I$(top_srcdir)/modules/types/includes \
-        -I$(top_srcdir)/modules/symbol/includes \
-        -I$(top_srcdir)/modules/ast/includes \
-        -I$(top_srcdir)/modules/elementary_functions/includes \
-        -I$(top_srcdir)/modules/core/includes \
-        -I$(top_srcdir)/modules/operations/includes \
-        -I$(top_srcdir)/modules/api_scilab/includes
+    -I$(srcdir)/includes/ \
+    -I$(top_srcdir)/modules/functions_manager/includes \
+    -I$(top_srcdir)/modules/types/includes \
+    -I$(top_srcdir)/modules/symbol/includes \
+    -I$(top_srcdir)/modules/ast/includes \
+    -I$(top_srcdir)/modules/elementary_functions/includes \
+    -I$(top_srcdir)/modules/core/includes \
+    -I$(top_srcdir)/modules/operations/includes \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes
 
 pkglib_LTLIBRARIES = libsciboolean.la
 noinst_LTLIBRARIES = libsciboolean-algo.la
 libsciboolean_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
-libsciboolean_algo_la_SOURCES = $(BOOLEAN_C_SOURCES) $(BOOLEAN_FORTRAN_SOURCES) $(BOOLEAN_CPP_SOURCES)
+libsciboolean_algo_la_SOURCES = $(BOOLEAN_C_SOURCES) $(BOOLEAN_FORTRAN_SOURCES) $(BOOLEAN_CPP_SOURCES) $(GATEWAY_CPP_SOURCES)
 libsciboolean_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
 libsciboolean_algo_la_CFLAGS = $(libsciboolean_la_CFLAGS)
 libsciboolean_algo_la_CPPFLAGS = $(libsciboolean_la_CPPFLAGS)
@@ -639,6 +649,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciboolean_algo_la-boolean_gw.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciboolean_algo_la-matboolean.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciboolean_algo_la-sci_bool2s.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciboolean_algo_la-vect_and.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciboolean_algo_la-vect_or.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciboolean_la-gw_boolean.Plo@am__quote@
@@ -752,6 +763,13 @@ libsciboolean_algo_la-boolean_gw.lo: src/cpp/boolean_gw.cpp
 @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) $(libsciboolean_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsciboolean_algo_la-boolean_gw.lo `test -f 'src/cpp/boolean_gw.cpp' || echo '$(srcdir)/'`src/cpp/boolean_gw.cpp
 
+libsciboolean_algo_la-sci_bool2s.lo: sci_gateway/cpp/sci_bool2s.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciboolean_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsciboolean_algo_la-sci_bool2s.lo -MD -MP -MF $(DEPDIR)/libsciboolean_algo_la-sci_bool2s.Tpo -c -o libsciboolean_algo_la-sci_bool2s.lo `test -f 'sci_gateway/cpp/sci_bool2s.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_bool2s.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libsciboolean_algo_la-sci_bool2s.Tpo $(DEPDIR)/libsciboolean_algo_la-sci_bool2s.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_bool2s.cpp' object='libsciboolean_algo_la-sci_bool2s.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) $(libsciboolean_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsciboolean_algo_la-sci_bool2s.lo `test -f 'sci_gateway/cpp/sci_bool2s.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_bool2s.cpp
+
 .f.o:
        $(F77COMPILE) -c -o $@ $<
 
index 0a64f59..a411397 100644 (file)
 #ifndef __BOOLEAN_GW_HXX__
 #define __BOOLEAN_GW_HXX__
 
+#include "cpp_gateway_prototype.hxx"
+
+extern "C"
+{
 #include "dynlib_boolean_gw.h"
+}
 
 class BooleanModule
 {
@@ -24,4 +29,6 @@ public :
        BOOLEAN_GW_IMPEXP static int Load();
 };
 
+CPP_GATEWAY_PROTOTYPE(sci_bool2s);
+
 #endif /* __BOOLEAN_GW_HXX__ */
diff --git a/scilab/modules/boolean/sci_gateway/cpp/sci_bool2s.cpp b/scilab/modules/boolean/sci_gateway/cpp/sci_bool2s.cpp
new file mode 100644 (file)
index 0000000..1297faf
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+* 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 "boolean_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "bool.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_bool2s(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::InternalType* pOut = NULL;
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"bool2s", 1);
+        return types::Function::Error;
+    }
+
+    if(in[0]->isDouble())
+    {
+        types::Double* pIn = in[0]->getAs<types::Double>();
+
+        types::Double* pD = new types::Double(pIn->getDims(), pIn->getDimsArray());
+        for(int i = 0 ; i < pIn->getSize() ; i++)
+        {
+            pD->set(i, pIn->get(i) != 0);
+        }
+        pOut = pD;
+    }
+    else if(in[0]->isBool())
+    {
+        types::Bool* pIn = in[0]->getAs<types::Bool>();
+
+        types::Double* pD = new types::Double(pIn->getDims(), pIn->getDimsArray());
+        for(int i = 0 ; i < pIn->getSize() ; i++)
+        {
+            pD->set(i, pIn->get(i));
+        }
+        pOut = pD;
+    }
+    //else if(in[0]->isSparse())
+    //{
+    //}
+    //else if(in[0]->isBooleanSparse())
+    //{
+    //}
+    else
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d: %s or %s expected.\n"), L"bool2s", 1, L"bool", L"double");
+        return types::Function::Error;
+    }
+
+    out.push_back(pOut);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
index 34f4e93..2f095e2 100644 (file)
@@ -26,6 +26,7 @@ int BooleanModule::Load()
 {
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"or", &sci_or, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"and", &sci_and, MODULE_NAME));
+       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"bool2s", &sci_bool2s, MODULE_NAME));
        return 1;
 }
 
index 79a5537..1f4c968 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BOOLEAN_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -99,7 +99,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BOOLEAN_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BOOLEAN_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../functions_manager/includes;../../../types/includes;../../../symbol/includes;../../../ast/includes;../../../elementary_functions/includes;../../../core/includes;../../../operations/includes;../../../api_scilab/includes;../../../localization/includes;../../../../libs/intl;../../../output_stream/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BOOLEAN_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_bool2s.cpp" />
     <ClCompile Include="boolean_gw.cpp" />
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <Library Include="..\..\..\..\bin\blasplus.lib" />
     <Library Include="..\..\..\..\bin\lapack.lib" />
+    <Library Include="..\..\..\..\bin\libintl.lib" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </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>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 2e41e1f..67df5fb 100644 (file)
@@ -18,6 +18,9 @@
     <ClCompile Include="boolean_gw.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_bool2s.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\boolean_gw.hxx">
@@ -30,5 +33,6 @@
   <ItemGroup>
     <Library Include="..\..\..\..\bin\blasplus.lib" />
     <Library Include="..\..\..\..\bin\lapack.lib" />
+    <Library Include="..\..\..\..\bin\libintl.lib" />
   </ItemGroup>
 </Project>
\ No newline at end of file
index 1f1075d..1cc0bd0 100644 (file)
@@ -154,14 +154,12 @@ src/fortran/qitz.f \
 src/fortran/front.f
 
 GATEWAY_C_SOURCES = sci_gateway/c/sci_arl2.c \
-sci_gateway/c/sci_gspec.c \
 sci_gateway/c/sci_rtitr.c \
 sci_gateway/c/sci_ereduc.c \
 sci_gateway/c/sci_ppol.c \
 sci_gateway/c/sci_tzer.c \
 sci_gateway/c/sci_contr.c \
 sci_gateway/c/sci_fstair.c \
-sci_gateway/c/sci_gschur.c \
 sci_gateway/c/sci_residu.c \
 sci_gateway/c/gw_slicot.c \
 sci_gateway/c/gw_cacsd0.c \
@@ -172,8 +170,8 @@ sci_gateway/c/sci_ltitr.c \
 sci_gateway/c/sci_ldiv.c \
 sci_gateway/c/gw_cacsd2.c \
 sci_gateway/c/gw_cacsd3.c
-
-
+#sci_gateway/c/sci_gschur.c => obsolete
+#sci_gateway/c/sci_gspec.c => obsolete
 
 GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_hinf.f \
 sci_gateway/fortran/sci_f_zrankqr.f \
@@ -193,13 +191,13 @@ sci_gateway/fortran/sci_f_ltitr.f \
 sci_gateway/fortran/sci_f_dhinf.f \
 sci_gateway/fortran/sci_f_ricc2.f \
 sci_gateway/fortran/sci_f_arl2.f \
-sci_gateway/fortran/sci_f_gschur.f \
 sci_gateway/fortran/sci_f_ereduc.f \
 sci_gateway/fortran/sci_f_findbd.f \
 sci_gateway/fortran/sci_f_fstair.f \
-sci_gateway/fortran/sci_f_gspec.f \
 sci_gateway/fortran/sci_f_linmeq.f \
 sci_gateway/fortran/sci_f_rankqr.f
+#sci_gateway/fortran/sci_f_gschur.f => obsolete
+#sci_gateway/fortran/sci_f_gspec.f => obsolete
 
 libscicacsd_la_FFLAGS= -I$(srcdir)/includes/
 libscicacsd_la_CFLAGS=         -I$(srcdir)/includes/ \
index 0ffaa9b..a199347 100644 (file)
@@ -153,15 +153,13 @@ am__objects_3 = libscicacsd_la-sci_f_hinf.lo \
        libscicacsd_la-sci_f_rtitr.lo libscicacsd_la-sci_f_sorder.lo \
        libscicacsd_la-sci_f_mucomp.lo libscicacsd_la-sci_f_ltitr.lo \
        libscicacsd_la-sci_f_dhinf.lo libscicacsd_la-sci_f_ricc2.lo \
-       libscicacsd_la-sci_f_arl2.lo libscicacsd_la-sci_f_gschur.lo \
-       libscicacsd_la-sci_f_ereduc.lo libscicacsd_la-sci_f_findbd.lo \
-       libscicacsd_la-sci_f_fstair.lo libscicacsd_la-sci_f_gspec.lo \
+       libscicacsd_la-sci_f_arl2.lo libscicacsd_la-sci_f_ereduc.lo \
+       libscicacsd_la-sci_f_findbd.lo libscicacsd_la-sci_f_fstair.lo \
        libscicacsd_la-sci_f_linmeq.lo libscicacsd_la-sci_f_rankqr.lo
-am__objects_4 = libscicacsd_la-sci_arl2.lo libscicacsd_la-sci_gspec.lo \
-       libscicacsd_la-sci_rtitr.lo libscicacsd_la-sci_ereduc.lo \
-       libscicacsd_la-sci_ppol.lo libscicacsd_la-sci_tzer.lo \
-       libscicacsd_la-sci_contr.lo libscicacsd_la-sci_fstair.lo \
-       libscicacsd_la-sci_gschur.lo libscicacsd_la-sci_residu.lo \
+am__objects_4 = libscicacsd_la-sci_arl2.lo libscicacsd_la-sci_rtitr.lo \
+       libscicacsd_la-sci_ereduc.lo libscicacsd_la-sci_ppol.lo \
+       libscicacsd_la-sci_tzer.lo libscicacsd_la-sci_contr.lo \
+       libscicacsd_la-sci_fstair.lo libscicacsd_la-sci_residu.lo \
        libscicacsd_la-gw_slicot.lo libscicacsd_la-gw_cacsd0.lo \
        libscicacsd_la-sci_freq.lo libscicacsd_la-gw_cacsd1.lo \
        libscicacsd_la-sci_rankqr.lo libscicacsd_la-sci_ltitr.lo \
@@ -609,14 +607,12 @@ src/fortran/qitz.f \
 src/fortran/front.f
 
 GATEWAY_C_SOURCES = sci_gateway/c/sci_arl2.c \
-sci_gateway/c/sci_gspec.c \
 sci_gateway/c/sci_rtitr.c \
 sci_gateway/c/sci_ereduc.c \
 sci_gateway/c/sci_ppol.c \
 sci_gateway/c/sci_tzer.c \
 sci_gateway/c/sci_contr.c \
 sci_gateway/c/sci_fstair.c \
-sci_gateway/c/sci_gschur.c \
 sci_gateway/c/sci_residu.c \
 sci_gateway/c/gw_slicot.c \
 sci_gateway/c/gw_cacsd0.c \
@@ -628,6 +624,8 @@ sci_gateway/c/sci_ldiv.c \
 sci_gateway/c/gw_cacsd2.c \
 sci_gateway/c/gw_cacsd3.c
 
+#sci_gateway/c/sci_gschur.c => obsolete
+#sci_gateway/c/sci_gspec.c => obsolete
 GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_hinf.f \
 sci_gateway/fortran/sci_f_zrankqr.f \
 sci_gateway/fortran/sci_f_tzer.f \
@@ -646,14 +644,14 @@ sci_gateway/fortran/sci_f_ltitr.f \
 sci_gateway/fortran/sci_f_dhinf.f \
 sci_gateway/fortran/sci_f_ricc2.f \
 sci_gateway/fortran/sci_f_arl2.f \
-sci_gateway/fortran/sci_f_gschur.f \
 sci_gateway/fortran/sci_f_ereduc.f \
 sci_gateway/fortran/sci_f_findbd.f \
 sci_gateway/fortran/sci_f_fstair.f \
-sci_gateway/fortran/sci_f_gspec.f \
 sci_gateway/fortran/sci_f_linmeq.f \
 sci_gateway/fortran/sci_f_rankqr.f
 
+#sci_gateway/fortran/sci_f_gschur.f => obsolete
+#sci_gateway/fortran/sci_f_gspec.f => obsolete
 libscicacsd_la_FFLAGS = -I$(srcdir)/includes/
 libscicacsd_la_CFLAGS = -I$(srcdir)/includes/ \
                        -I$(top_srcdir)/modules/output_stream/includes/ \
@@ -847,8 +845,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicacsd_la-sci_ereduc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicacsd_la-sci_freq.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicacsd_la-sci_fstair.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicacsd_la-sci_gschur.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicacsd_la-sci_gspec.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicacsd_la-sci_ldiv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicacsd_la-sci_ltitr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicacsd_la-sci_ppol.Plo@am__quote@
@@ -885,13 +881,6 @@ libscicacsd_la-sci_arl2.lo: sci_gateway/c/sci_arl2.c
 @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) $(libscicacsd_la_CFLAGS) $(CFLAGS) -c -o libscicacsd_la-sci_arl2.lo `test -f 'sci_gateway/c/sci_arl2.c' || echo '$(srcdir)/'`sci_gateway/c/sci_arl2.c
 
-libscicacsd_la-sci_gspec.lo: sci_gateway/c/sci_gspec.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicacsd_la_CFLAGS) $(CFLAGS) -MT libscicacsd_la-sci_gspec.lo -MD -MP -MF $(DEPDIR)/libscicacsd_la-sci_gspec.Tpo -c -o libscicacsd_la-sci_gspec.lo `test -f 'sci_gateway/c/sci_gspec.c' || echo '$(srcdir)/'`sci_gateway/c/sci_gspec.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicacsd_la-sci_gspec.Tpo $(DEPDIR)/libscicacsd_la-sci_gspec.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_gspec.c' object='libscicacsd_la-sci_gspec.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) $(libscicacsd_la_CFLAGS) $(CFLAGS) -c -o libscicacsd_la-sci_gspec.lo `test -f 'sci_gateway/c/sci_gspec.c' || echo '$(srcdir)/'`sci_gateway/c/sci_gspec.c
-
 libscicacsd_la-sci_rtitr.lo: sci_gateway/c/sci_rtitr.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicacsd_la_CFLAGS) $(CFLAGS) -MT libscicacsd_la-sci_rtitr.lo -MD -MP -MF $(DEPDIR)/libscicacsd_la-sci_rtitr.Tpo -c -o libscicacsd_la-sci_rtitr.lo `test -f 'sci_gateway/c/sci_rtitr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_rtitr.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicacsd_la-sci_rtitr.Tpo $(DEPDIR)/libscicacsd_la-sci_rtitr.Plo
@@ -934,13 +923,6 @@ libscicacsd_la-sci_fstair.lo: sci_gateway/c/sci_fstair.c
 @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) $(libscicacsd_la_CFLAGS) $(CFLAGS) -c -o libscicacsd_la-sci_fstair.lo `test -f 'sci_gateway/c/sci_fstair.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fstair.c
 
-libscicacsd_la-sci_gschur.lo: sci_gateway/c/sci_gschur.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicacsd_la_CFLAGS) $(CFLAGS) -MT libscicacsd_la-sci_gschur.lo -MD -MP -MF $(DEPDIR)/libscicacsd_la-sci_gschur.Tpo -c -o libscicacsd_la-sci_gschur.lo `test -f 'sci_gateway/c/sci_gschur.c' || echo '$(srcdir)/'`sci_gateway/c/sci_gschur.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicacsd_la-sci_gschur.Tpo $(DEPDIR)/libscicacsd_la-sci_gschur.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_gschur.c' object='libscicacsd_la-sci_gschur.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) $(libscicacsd_la_CFLAGS) $(CFLAGS) -c -o libscicacsd_la-sci_gschur.lo `test -f 'sci_gateway/c/sci_gschur.c' || echo '$(srcdir)/'`sci_gateway/c/sci_gschur.c
-
 libscicacsd_la-sci_residu.lo: sci_gateway/c/sci_residu.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicacsd_la_CFLAGS) $(CFLAGS) -MT libscicacsd_la-sci_residu.lo -MD -MP -MF $(DEPDIR)/libscicacsd_la-sci_residu.Tpo -c -o libscicacsd_la-sci_residu.lo `test -f 'sci_gateway/c/sci_residu.c' || echo '$(srcdir)/'`sci_gateway/c/sci_residu.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicacsd_la-sci_residu.Tpo $(DEPDIR)/libscicacsd_la-sci_residu.Plo
@@ -1512,9 +1494,6 @@ libscicacsd_la-sci_f_ricc2.lo: sci_gateway/fortran/sci_f_ricc2.f
 libscicacsd_la-sci_f_arl2.lo: sci_gateway/fortran/sci_f_arl2.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(libscicacsd_la_FFLAGS) $(FFLAGS) -c -o libscicacsd_la-sci_f_arl2.lo `test -f 'sci_gateway/fortran/sci_f_arl2.f' || echo '$(srcdir)/'`sci_gateway/fortran/sci_f_arl2.f
 
-libscicacsd_la-sci_f_gschur.lo: sci_gateway/fortran/sci_f_gschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(libscicacsd_la_FFLAGS) $(FFLAGS) -c -o libscicacsd_la-sci_f_gschur.lo `test -f 'sci_gateway/fortran/sci_f_gschur.f' || echo '$(srcdir)/'`sci_gateway/fortran/sci_f_gschur.f
-
 libscicacsd_la-sci_f_ereduc.lo: sci_gateway/fortran/sci_f_ereduc.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(libscicacsd_la_FFLAGS) $(FFLAGS) -c -o libscicacsd_la-sci_f_ereduc.lo `test -f 'sci_gateway/fortran/sci_f_ereduc.f' || echo '$(srcdir)/'`sci_gateway/fortran/sci_f_ereduc.f
 
@@ -1524,9 +1503,6 @@ libscicacsd_la-sci_f_findbd.lo: sci_gateway/fortran/sci_f_findbd.f
 libscicacsd_la-sci_f_fstair.lo: sci_gateway/fortran/sci_f_fstair.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(libscicacsd_la_FFLAGS) $(FFLAGS) -c -o libscicacsd_la-sci_f_fstair.lo `test -f 'sci_gateway/fortran/sci_f_fstair.f' || echo '$(srcdir)/'`sci_gateway/fortran/sci_f_fstair.f
 
-libscicacsd_la-sci_f_gspec.lo: sci_gateway/fortran/sci_f_gspec.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(libscicacsd_la_FFLAGS) $(FFLAGS) -c -o libscicacsd_la-sci_f_gspec.lo `test -f 'sci_gateway/fortran/sci_f_gspec.f' || echo '$(srcdir)/'`sci_gateway/fortran/sci_f_gspec.f
-
 libscicacsd_la-sci_f_linmeq.lo: sci_gateway/fortran/sci_f_linmeq.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(libscicacsd_la_FFLAGS) $(FFLAGS) -c -o libscicacsd_la-sci_f_linmeq.lo `test -f 'sci_gateway/fortran/sci_f_linmeq.f' || echo '$(srcdir)/'`sci_gateway/fortran/sci_f_linmeq.f
 
index bf52f12..8628d3f 100644 (file)
@@ -19,8 +19,8 @@
 /*--------------------------------------------------------------------------*/
 CACSD_IMPEXP int gw_cacsd0(void);
 /*--------------------------------------------------------------------------*/
-int sci_gschur(char *fname,unsigned long fname_len);
-int sci_gspec(char *fname,unsigned long fname_len);
+//int sci_gschur(char *fname,unsigned long fname_len); obsolete
+//int sci_gspec(char *fname,unsigned long fname_len); obsolete
 int sci_ereduc(char *fname,unsigned long fname_len);
 int sci_fstair(char *fname,unsigned long fname_len);
 /*--------------------------------------------------------------------------*/
index a259796..eeb3354 100644 (file)
@@ -20,8 +20,8 @@
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
-    {sci_gschur, "gschur"},
-    {sci_gspec, "gspec"},
+//    {sci_gschur, "gschur"}, obsolete (use schur in linear algebra)
+//    {sci_gspec, "gspec"}, obsolete (use spec in linear algebra)
     {sci_ereduc, "ereduc"},
     {sci_fstair, "fstair"}
 };
index e336c9d..4debef6 100644 (file)
@@ -66,6 +66,7 @@ int ElemFuncModule::Load()
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"tan", &sci_tan, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"testmatrix", &sci_testmatrix, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"tril", &sci_tril, MODULE_NAME));
+       symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"triu", &sci_triu, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"zeros", &sci_zeros, MODULE_NAME));
        return 1;
 }
index 3a40d04..3436a11 100644 (file)
       <Project>{2d02dd0e-cbf5-493e-aa06-1e289ed24666}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\linear_algebra\sci_gateway\cpp\linear_algebra_gw.vcxproj">
+      <Project>{ee43be6d-817d-4b09-ac40-7e6ac5bdb80d}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\localization\sci_gateway\cpp\localization_gw.vcxproj">
       <Project>{7a68edc6-f0af-47d1-bb16-b8a9dcd9202d}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index e0eda7a..3ee244e 100644 (file)
@@ -37,5 +37,6 @@
 #include "../../history_manager/includes/history_manager_gw.hxx"
 #include "../../console/includes/console_gw.hxx"
 #include "../../signal_processing/includes/signal_gw.hxx"
+#include "../../linear_algebra/includes/linear_algebra_gw.hxx"
 
 #endif /* !__MODULE_DECLARATION_HXX__ */
index e3be038..c0a9f72 100644 (file)
@@ -305,6 +305,7 @@ bool FuncManager::CreateModuleList(void)
     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));
+    m_ModuleMap.insert(pair<wstring, GW_MOD>(L"linear_algebra", &LinearAlgebraModule::Load));
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
         m_ModuleMap.insert(pair<wstring, GW_MOD>(L"jvm", &JvmModule::Load));
index fdfae91..d8e5f58 100644 (file)
@@ -46,7 +46,7 @@ GATEWAY_CPP_SOURCES = \
 if GUI
 
 # List of the c files
-HISTORY_MANAGER_C_SOURCES += \ 
+HISTORY_MANAGER_C_SOURCES += \
     src/jni/HistoryManagement_wrap.c
 
 USEANT=1
index 9660c68..5eb754c 100644 (file)
@@ -3,6 +3,8 @@
 #
 # This file is distributed under the same license as the Scilab package.
 
+LINEAR_ALGEBRA_CPP_SOURCES = src/cpp/scischur.cpp \
+src/cpp/schurSelect.cpp
 
 LINEAR_ALGEBRA_C_SOURCES = src/c/schurtable.c \
 src/c/invert_matrix.c \
@@ -15,7 +17,6 @@ src/c/chol.c \
 src/c/svd.c \
 src/c/rcond.c \
 src/c/det.c \
-src/c/schur.c \
 src/c/lsq.c \
 src/c/issymmetric.c
 
@@ -23,73 +24,45 @@ LINEAR_ALGEBRA_FORTRAN_SOURCES = src/fortran/intdggbal.f \
 src/fortran/intzgeqpf4.f \
 src/fortran/intzgehrd.f \
 src/fortran/intzgesvd1.f \
-src/fortran/intzfschur.f \
 src/fortran/intzgesvd2.f \
-src/fortran/intdgges.f \
-src/fortran/intgschur.f \
 src/fortran/intdgesv3.f \
 src/fortran/intdgesv4.f \
 src/fortran/DGELSY1.f \
-src/fortran/intozgschur.f \
 src/fortran/intdpotrf.f \
 src/fortran/intdoldsvd.f \
 src/fortran/intdgecon.f \
 src/fortran/zoldqr.f \
 src/fortran/intzgetrf.f \
-src/fortran/intoschur.f \
 src/fortran/complexify.f \
 src/fortran/intzgebal.f \
 src/fortran/intzgetri.f \
 src/fortran/intzggbal.f \
-src/fortran/intdgees0.f \
-src/fortran/intdgees1.f \
-src/fortran/intogschur.f \
-src/fortran/intzgges.f \
 src/fortran/intddet.f \
 src/fortran/intzgesv3.f \
 src/fortran/intzgesv4.f \
 src/fortran/intzpotrf.f \
 src/fortran/intzgecon.f \
-src/fortran/intzgschur.f \
 src/fortran/intzoldsvd.f \
 src/fortran/intdgelsy.f \
 src/fortran/intdgeqpf3.f \
-src/fortran/intfschur.f \
 src/fortran/intdgeqpf4.f \
 src/fortran/intdgesvd1.f \
 src/fortran/intdgehrd.f \
-src/fortran/intzgees0.f \
 src/fortran/intdgesvd2.f \
-src/fortran/intzgees1.f \
 src/fortran/intzdet.f \
 src/fortran/doldqr.f \
-src/fortran/scischur.f \
 src/fortran/intdgetrf.f \
 src/fortran/intzgelsy.f \
 src/fortran/intdgetri.f \
 src/fortran/intdgebal.f \
-src/fortran/intzschur.f \
 src/fortran/intzgeqpf3.f \
-src/fortran/writebuf.f
-#src/fortran/issymmetric.f
+src/fortran/writebuf.f \
+src/fortran/intzschur.f
 
 GATEWAY_C_SOURCES = sci_gateway/c/sci_backslash.c \
-sci_gateway/c/sci_hess.c \
-sci_gateway/c/sci_rcond.c \
-sci_gateway/c/sci_bdiag.c \
 sci_gateway/c/sci_slash.c \
 sci_gateway/c/gw_linear_algebra2.c \
-sci_gateway/c/sci_det.c \
-sci_gateway/c/sci_lu.c \
-sci_gateway/c/sci_balanc.c \
-sci_gateway/c/sci_qr.c \
-sci_gateway/c/sci_schur.c \
-sci_gateway/c/sci_chol.c \
-sci_gateway/c/sci_eig.c \
 sci_gateway/c/gw_linear_algebra.c \
-sci_gateway/c/sci_inv.c \
-sci_gateway/c/sci_svd.c \
-sci_gateway/c/sci_lsq.c \
 sci_gateway/c/assembleEigenvectors.c \
 sci_gateway/c/sci_dgeev.c \
 sci_gateway/c/sci_dggev.c \
@@ -100,6 +73,22 @@ sci_gateway/c/sci_zheev.c
 
 GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/bschur.f
 
+GATEWAY_CPP_SOURCES = sci_gateway/cpp/linear_algebra_gw.cpp \
+sci_gateway/cpp/sci_chol.cpp \
+sci_gateway/cpp/sci_bdiag.cpp \
+sci_gateway/cpp/sci_inv.cpp \
+sci_gateway/cpp/sci_svd.cpp \
+sci_gateway/cpp/sci_rcond.cpp \
+sci_gateway/cpp/sci_qr.cpp \
+sci_gateway/cpp/sci_lu.cpp \
+sci_gateway/cpp/sci_lsq.cpp \
+sci_gateway/cpp/sci_hess.cpp \
+sci_gateway/cpp/sci_spec.cpp \
+sci_gateway/cpp/sci_det.cpp \
+sci_gateway/cpp/sci_balanc.cpp \
+sci_gateway/cpp/sci_schur.cpp
+
+
 libscilinear_algebra_la_CFLAGS=        -I$(srcdir)/includes/ \
 -I$(srcdir)/src/c/ \
 -I$(top_srcdir)/modules/output_stream/includes \
@@ -108,16 +97,29 @@ libscilinear_algebra_la_CFLAGS=    -I$(srcdir)/includes/ \
 -I$(top_srcdir)/modules/elementary_functions/includes \
 -I$(top_srcdir)/modules/api_scilab/includes
 
+libscilinear_algebra_la_CPPFLAGS=      -I$(srcdir)/includes/ \
+-I$(srcdir)/src/cpp/ \
+-I$(top_srcdir)/modules/symbol/includes \
+-I$(top_srcdir)/modules/types/includes \
+-I$(top_srcdir)/modules/ast/includes \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/threads/includes \
+-I$(top_srcdir)/modules/system_env/includes \
+-I$(top_srcdir)/modules/string/includes \
+-I$(top_srcdir)/modules/elementary_functions/includes \
+-I$(top_srcdir)/modules/dynamic_link/includes \
+-I$(top_srcdir)/modules/operations/includes
 
 pkglib_LTLIBRARIES = libscilinear_algebra.la
 noinst_LTLIBRARIES = libscilinear_algebra-algo.la
 
 libscilinear_algebra_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
 
-libscilinear_algebra_algo_la_SOURCES = $(LINEAR_ALGEBRA_FORTRAN_SOURCES) $(LINEAR_ALGEBRA_C_SOURCES)
-libscilinear_algebra_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscilinear_algebra_algo_la_SOURCES = $(LINEAR_ALGEBRA_FORTRAN_SOURCES) $(LINEAR_ALGEBRA_C_SOURCES) $(LINEAR_ALGEBRA_CPP_SOURCES)
+libscilinear_algebra_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
 libscilinear_algebra_algo_la_CFLAGS = $(libscilinear_algebra_la_CFLAGS)
-
+libscilinear_algebra_algo_la_CPPFLAGS = $(libscilinear_algebra_la_CPPFLAGS)
 # For the code check (splint)
 CHECK_SRC= $(LINEAR_ALGEBRA_C_SOURCES) $(GATEWAY_C_SOURCES)
 INCLUDE_FLAGS = $(libscilinear_algebra_la_CFLAGS)
index 90953f1..83c9dc0 100644 (file)
@@ -110,18 +110,14 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" \
 LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libscilinear_algebra_algo_la_LIBADD =
 am__objects_1 = intdggbal.lo intzgeqpf4.lo intzgehrd.lo intzgesvd1.lo \
-       intzfschur.lo intzgesvd2.lo intdgges.lo intgschur.lo \
-       intdgesv3.lo intdgesv4.lo DGELSY1.lo intozgschur.lo \
+       intzgesvd2.lo intdgesv3.lo intdgesv4.lo DGELSY1.lo \
        intdpotrf.lo intdoldsvd.lo intdgecon.lo zoldqr.lo intzgetrf.lo \
-       intoschur.lo complexify.lo intzgebal.lo intzgetri.lo \
-       intzggbal.lo intdgees0.lo intdgees1.lo intogschur.lo \
-       intzgges.lo intddet.lo intzgesv3.lo intzgesv4.lo intzpotrf.lo \
-       intzgecon.lo intzgschur.lo intzoldsvd.lo intdgelsy.lo \
-       intdgeqpf3.lo intfschur.lo intdgeqpf4.lo intdgesvd1.lo \
-       intdgehrd.lo intzgees0.lo intdgesvd2.lo intzgees1.lo \
-       intzdet.lo doldqr.lo scischur.lo intdgetrf.lo intzgelsy.lo \
-       intdgetri.lo intdgebal.lo intzschur.lo intzgeqpf3.lo \
-       writebuf.lo
+       complexify.lo intzgebal.lo intzgetri.lo intzggbal.lo \
+       intddet.lo intzgesv3.lo intzgesv4.lo intzpotrf.lo intzgecon.lo \
+       intzoldsvd.lo intdgelsy.lo intdgeqpf3.lo intdgeqpf4.lo \
+       intdgesvd1.lo intdgehrd.lo intdgesvd2.lo intzdet.lo doldqr.lo \
+       intdgetrf.lo intzgelsy.lo intdgetri.lo intdgebal.lo \
+       intzgeqpf3.lo writebuf.lo intzschur.lo
 am__objects_2 = libscilinear_algebra_algo_la-schurtable.lo \
        libscilinear_algebra_algo_la-invert_matrix.lo \
        libscilinear_algebra_algo_la-lu.lo \
@@ -133,11 +129,12 @@ am__objects_2 = libscilinear_algebra_algo_la-schurtable.lo \
        libscilinear_algebra_algo_la-svd.lo \
        libscilinear_algebra_algo_la-rcond.lo \
        libscilinear_algebra_algo_la-det.lo \
-       libscilinear_algebra_algo_la-schur.lo \
        libscilinear_algebra_algo_la-lsq.lo \
        libscilinear_algebra_algo_la-issymmetric.lo
+am__objects_3 = libscilinear_algebra_algo_la-scischur.lo \
+       libscilinear_algebra_algo_la-schurSelect.lo
 am_libscilinear_algebra_algo_la_OBJECTS = $(am__objects_1) \
-       $(am__objects_2)
+       $(am__objects_2) $(am__objects_3)
 libscilinear_algebra_algo_la_OBJECTS =  \
        $(am_libscilinear_algebra_algo_la_OBJECTS)
 libscilinear_algebra_la_DEPENDENCIES = libscilinear_algebra-algo.la \
@@ -145,23 +142,10 @@ libscilinear_algebra_la_DEPENDENCIES = libscilinear_algebra-algo.la \
        $(top_builddir)/modules/dynamic_link/libscidynamic_link.la \
        $(top_builddir)/modules/arnoldi/libsciarnoldi.la \
        $(top_builddir)/modules/output_stream/libscioutput_stream.la
-am__objects_3 = libscilinear_algebra_la-sci_backslash.lo \
-       libscilinear_algebra_la-sci_hess.lo \
-       libscilinear_algebra_la-sci_rcond.lo \
-       libscilinear_algebra_la-sci_bdiag.lo \
+am__objects_4 = libscilinear_algebra_la-sci_backslash.lo \
        libscilinear_algebra_la-sci_slash.lo \
        libscilinear_algebra_la-gw_linear_algebra2.lo \
-       libscilinear_algebra_la-sci_det.lo \
-       libscilinear_algebra_la-sci_lu.lo \
-       libscilinear_algebra_la-sci_balanc.lo \
-       libscilinear_algebra_la-sci_qr.lo \
-       libscilinear_algebra_la-sci_schur.lo \
-       libscilinear_algebra_la-sci_chol.lo \
-       libscilinear_algebra_la-sci_eig.lo \
        libscilinear_algebra_la-gw_linear_algebra.lo \
-       libscilinear_algebra_la-sci_inv.lo \
-       libscilinear_algebra_la-sci_svd.lo \
-       libscilinear_algebra_la-sci_lsq.lo \
        libscilinear_algebra_la-assembleEigenvectors.lo \
        libscilinear_algebra_la-sci_dgeev.lo \
        libscilinear_algebra_la-sci_dggev.lo \
@@ -169,13 +153,29 @@ am__objects_3 = libscilinear_algebra_la-sci_backslash.lo \
        libscilinear_algebra_la-sci_zgeev.lo \
        libscilinear_algebra_la-sci_zggev.lo \
        libscilinear_algebra_la-sci_zheev.lo
-am__objects_4 = bschur.lo
-am_libscilinear_algebra_la_OBJECTS = $(am__objects_3) $(am__objects_4)
+am__objects_5 = libscilinear_algebra_la-linear_algebra_gw.lo \
+       libscilinear_algebra_la-sci_chol.lo \
+       libscilinear_algebra_la-sci_bdiag.lo \
+       libscilinear_algebra_la-sci_inv.lo \
+       libscilinear_algebra_la-sci_svd.lo \
+       libscilinear_algebra_la-sci_rcond.lo \
+       libscilinear_algebra_la-sci_qr.lo \
+       libscilinear_algebra_la-sci_lu.lo \
+       libscilinear_algebra_la-sci_lsq.lo \
+       libscilinear_algebra_la-sci_hess.lo \
+       libscilinear_algebra_la-sci_spec.lo \
+       libscilinear_algebra_la-sci_det.lo \
+       libscilinear_algebra_la-sci_balanc.lo \
+       libscilinear_algebra_la-sci_schur.lo
+am__objects_6 = bschur.lo
+am_libscilinear_algebra_la_OBJECTS = $(am__objects_4) $(am__objects_5) \
+       $(am__objects_6)
 libscilinear_algebra_la_OBJECTS =  \
        $(am_libscilinear_algebra_la_OBJECTS)
-libscilinear_algebra_la_LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \
-       $(libscilinear_algebra_la_LDFLAGS) $(LDFLAGS) -o $@
+libscilinear_algebra_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(libscilinear_algebra_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
@@ -189,6 +189,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)
@@ -465,6 +474,9 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
+LINEAR_ALGEBRA_CPP_SOURCES = src/cpp/scischur.cpp \
+src/cpp/schurSelect.cpp
+
 LINEAR_ALGEBRA_C_SOURCES = src/c/schurtable.c \
 src/c/invert_matrix.c \
 src/c/lu.c \
@@ -476,7 +488,6 @@ src/c/chol.c \
 src/c/svd.c \
 src/c/rcond.c \
 src/c/det.c \
-src/c/schur.c \
 src/c/lsq.c \
 src/c/issymmetric.c
 
@@ -484,73 +495,45 @@ LINEAR_ALGEBRA_FORTRAN_SOURCES = src/fortran/intdggbal.f \
 src/fortran/intzgeqpf4.f \
 src/fortran/intzgehrd.f \
 src/fortran/intzgesvd1.f \
-src/fortran/intzfschur.f \
 src/fortran/intzgesvd2.f \
-src/fortran/intdgges.f \
-src/fortran/intgschur.f \
 src/fortran/intdgesv3.f \
 src/fortran/intdgesv4.f \
 src/fortran/DGELSY1.f \
-src/fortran/intozgschur.f \
 src/fortran/intdpotrf.f \
 src/fortran/intdoldsvd.f \
 src/fortran/intdgecon.f \
 src/fortran/zoldqr.f \
 src/fortran/intzgetrf.f \
-src/fortran/intoschur.f \
 src/fortran/complexify.f \
 src/fortran/intzgebal.f \
 src/fortran/intzgetri.f \
 src/fortran/intzggbal.f \
-src/fortran/intdgees0.f \
-src/fortran/intdgees1.f \
-src/fortran/intogschur.f \
-src/fortran/intzgges.f \
 src/fortran/intddet.f \
 src/fortran/intzgesv3.f \
 src/fortran/intzgesv4.f \
 src/fortran/intzpotrf.f \
 src/fortran/intzgecon.f \
-src/fortran/intzgschur.f \
 src/fortran/intzoldsvd.f \
 src/fortran/intdgelsy.f \
 src/fortran/intdgeqpf3.f \
-src/fortran/intfschur.f \
 src/fortran/intdgeqpf4.f \
 src/fortran/intdgesvd1.f \
 src/fortran/intdgehrd.f \
-src/fortran/intzgees0.f \
 src/fortran/intdgesvd2.f \
-src/fortran/intzgees1.f \
 src/fortran/intzdet.f \
 src/fortran/doldqr.f \
-src/fortran/scischur.f \
 src/fortran/intdgetrf.f \
 src/fortran/intzgelsy.f \
 src/fortran/intdgetri.f \
 src/fortran/intdgebal.f \
-src/fortran/intzschur.f \
 src/fortran/intzgeqpf3.f \
-src/fortran/writebuf.f
+src/fortran/writebuf.f \
+src/fortran/intzschur.f
 
-#src/fortran/issymmetric.f
 GATEWAY_C_SOURCES = sci_gateway/c/sci_backslash.c \
-sci_gateway/c/sci_hess.c \
-sci_gateway/c/sci_rcond.c \
-sci_gateway/c/sci_bdiag.c \
 sci_gateway/c/sci_slash.c \
 sci_gateway/c/gw_linear_algebra2.c \
-sci_gateway/c/sci_det.c \
-sci_gateway/c/sci_lu.c \
-sci_gateway/c/sci_balanc.c \
-sci_gateway/c/sci_qr.c \
-sci_gateway/c/sci_schur.c \
-sci_gateway/c/sci_chol.c \
-sci_gateway/c/sci_eig.c \
 sci_gateway/c/gw_linear_algebra.c \
-sci_gateway/c/sci_inv.c \
-sci_gateway/c/sci_svd.c \
-sci_gateway/c/sci_lsq.c \
 sci_gateway/c/assembleEigenvectors.c \
 sci_gateway/c/sci_dgeev.c \
 sci_gateway/c/sci_dggev.c \
@@ -560,6 +543,21 @@ sci_gateway/c/sci_zggev.c \
 sci_gateway/c/sci_zheev.c
 
 GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/bschur.f
+GATEWAY_CPP_SOURCES = sci_gateway/cpp/linear_algebra_gw.cpp \
+sci_gateway/cpp/sci_chol.cpp \
+sci_gateway/cpp/sci_bdiag.cpp \
+sci_gateway/cpp/sci_inv.cpp \
+sci_gateway/cpp/sci_svd.cpp \
+sci_gateway/cpp/sci_rcond.cpp \
+sci_gateway/cpp/sci_qr.cpp \
+sci_gateway/cpp/sci_lu.cpp \
+sci_gateway/cpp/sci_lsq.cpp \
+sci_gateway/cpp/sci_hess.cpp \
+sci_gateway/cpp/sci_spec.cpp \
+sci_gateway/cpp/sci_det.cpp \
+sci_gateway/cpp/sci_balanc.cpp \
+sci_gateway/cpp/sci_schur.cpp
+
 libscilinear_algebra_la_CFLAGS = -I$(srcdir)/includes/ \
 -I$(srcdir)/src/c/ \
 -I$(top_srcdir)/modules/output_stream/includes \
@@ -568,13 +566,27 @@ libscilinear_algebra_la_CFLAGS = -I$(srcdir)/includes/ \
 -I$(top_srcdir)/modules/elementary_functions/includes \
 -I$(top_srcdir)/modules/api_scilab/includes
 
+libscilinear_algebra_la_CPPFLAGS = -I$(srcdir)/includes/ \
+-I$(srcdir)/src/cpp/ \
+-I$(top_srcdir)/modules/symbol/includes \
+-I$(top_srcdir)/modules/types/includes \
+-I$(top_srcdir)/modules/ast/includes \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/threads/includes \
+-I$(top_srcdir)/modules/system_env/includes \
+-I$(top_srcdir)/modules/string/includes \
+-I$(top_srcdir)/modules/elementary_functions/includes \
+-I$(top_srcdir)/modules/dynamic_link/includes \
+-I$(top_srcdir)/modules/operations/includes
+
 pkglib_LTLIBRARIES = libscilinear_algebra.la
 noinst_LTLIBRARIES = libscilinear_algebra-algo.la
 libscilinear_algebra_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
-libscilinear_algebra_algo_la_SOURCES = $(LINEAR_ALGEBRA_FORTRAN_SOURCES) $(LINEAR_ALGEBRA_C_SOURCES)
-libscilinear_algebra_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscilinear_algebra_algo_la_SOURCES = $(LINEAR_ALGEBRA_FORTRAN_SOURCES) $(LINEAR_ALGEBRA_C_SOURCES) $(LINEAR_ALGEBRA_CPP_SOURCES)
+libscilinear_algebra_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
 libscilinear_algebra_algo_la_CFLAGS = $(libscilinear_algebra_la_CFLAGS)
-
+libscilinear_algebra_algo_la_CPPFLAGS = $(libscilinear_algebra_la_CPPFLAGS)
 # For the code check (splint)
 CHECK_SRC = $(LINEAR_ALGEBRA_C_SOURCES) $(GATEWAY_C_SOURCES)
 INCLUDE_FLAGS = $(libscilinear_algebra_la_CFLAGS)
@@ -659,7 +671,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 \
@@ -731,7 +743,7 @@ clean-pkglibLTLIBRARIES:
          rm -f "$${dir}/so_locations"; \
        done
 libscilinear_algebra-algo.la: $(libscilinear_algebra_algo_la_OBJECTS) $(libscilinear_algebra_algo_la_DEPENDENCIES) 
-       $(F77LINK)  $(libscilinear_algebra_algo_la_OBJECTS) $(libscilinear_algebra_algo_la_LIBADD) $(LIBS)
+       $(CXXLINK)  $(libscilinear_algebra_algo_la_OBJECTS) $(libscilinear_algebra_algo_la_LIBADD) $(LIBS)
 libscilinear_algebra.la: $(libscilinear_algebra_la_OBJECTS) $(libscilinear_algebra_la_DEPENDENCIES) 
        $(libscilinear_algebra_la_LINK) -rpath $(pkglibdir) $(libscilinear_algebra_la_OBJECTS) $(libscilinear_algebra_la_LIBADD) $(LIBS)
 
@@ -752,12 +764,14 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_algo_la-lu.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_algo_la-qr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_algo_la-rcond.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_algo_la-schur.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_algo_la-schurSelect.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_algo_la-schurtable.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_algo_la-scischur.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_algo_la-svd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-assembleEigenvectors.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-linear_algebra_gw.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_backslash.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_balanc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_bdiag.Plo@am__quote@
@@ -766,7 +780,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_dgeev.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_dggev.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_dsyev.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_eig.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_hess.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_inv.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_lsq.Plo@am__quote@
@@ -775,6 +788,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_rcond.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_schur.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_slash.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_spec.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_svd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_zgeev.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscilinear_algebra_la-sci_zggev.Plo@am__quote@
@@ -802,270 +816,305 @@ distclean-compile:
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
 
 libscilinear_algebra_algo_la-schurtable.lo: src/c/schurtable.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-schurtable.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-schurtable.Tpo -c -o libscilinear_algebra_algo_la-schurtable.lo `test -f 'src/c/schurtable.c' || echo '$(srcdir)/'`src/c/schurtable.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-schurtable.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-schurtable.Tpo -c -o libscilinear_algebra_algo_la-schurtable.lo `test -f 'src/c/schurtable.c' || echo '$(srcdir)/'`src/c/schurtable.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-schurtable.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-schurtable.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/schurtable.c' object='libscilinear_algebra_algo_la-schurtable.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-schurtable.lo `test -f 'src/c/schurtable.c' || echo '$(srcdir)/'`src/c/schurtable.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-schurtable.lo `test -f 'src/c/schurtable.c' || echo '$(srcdir)/'`src/c/schurtable.c
 
 libscilinear_algebra_algo_la-invert_matrix.lo: src/c/invert_matrix.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-invert_matrix.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-invert_matrix.Tpo -c -o libscilinear_algebra_algo_la-invert_matrix.lo `test -f 'src/c/invert_matrix.c' || echo '$(srcdir)/'`src/c/invert_matrix.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-invert_matrix.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-invert_matrix.Tpo -c -o libscilinear_algebra_algo_la-invert_matrix.lo `test -f 'src/c/invert_matrix.c' || echo '$(srcdir)/'`src/c/invert_matrix.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-invert_matrix.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-invert_matrix.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/invert_matrix.c' object='libscilinear_algebra_algo_la-invert_matrix.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-invert_matrix.lo `test -f 'src/c/invert_matrix.c' || echo '$(srcdir)/'`src/c/invert_matrix.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-invert_matrix.lo `test -f 'src/c/invert_matrix.c' || echo '$(srcdir)/'`src/c/invert_matrix.c
 
 libscilinear_algebra_algo_la-lu.lo: src/c/lu.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-lu.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-lu.Tpo -c -o libscilinear_algebra_algo_la-lu.lo `test -f 'src/c/lu.c' || echo '$(srcdir)/'`src/c/lu.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-lu.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-lu.Tpo -c -o libscilinear_algebra_algo_la-lu.lo `test -f 'src/c/lu.c' || echo '$(srcdir)/'`src/c/lu.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-lu.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-lu.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/lu.c' object='libscilinear_algebra_algo_la-lu.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-lu.lo `test -f 'src/c/lu.c' || echo '$(srcdir)/'`src/c/lu.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-lu.lo `test -f 'src/c/lu.c' || echo '$(srcdir)/'`src/c/lu.c
 
 libscilinear_algebra_algo_la-qr.lo: src/c/qr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-qr.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-qr.Tpo -c -o libscilinear_algebra_algo_la-qr.lo `test -f 'src/c/qr.c' || echo '$(srcdir)/'`src/c/qr.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-qr.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-qr.Tpo -c -o libscilinear_algebra_algo_la-qr.lo `test -f 'src/c/qr.c' || echo '$(srcdir)/'`src/c/qr.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-qr.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-qr.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/qr.c' object='libscilinear_algebra_algo_la-qr.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-qr.lo `test -f 'src/c/qr.c' || echo '$(srcdir)/'`src/c/qr.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-qr.lo `test -f 'src/c/qr.c' || echo '$(srcdir)/'`src/c/qr.c
 
 libscilinear_algebra_algo_la-hess.lo: src/c/hess.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-hess.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-hess.Tpo -c -o libscilinear_algebra_algo_la-hess.lo `test -f 'src/c/hess.c' || echo '$(srcdir)/'`src/c/hess.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-hess.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-hess.Tpo -c -o libscilinear_algebra_algo_la-hess.lo `test -f 'src/c/hess.c' || echo '$(srcdir)/'`src/c/hess.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-hess.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-hess.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/hess.c' object='libscilinear_algebra_algo_la-hess.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-hess.lo `test -f 'src/c/hess.c' || echo '$(srcdir)/'`src/c/hess.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-hess.lo `test -f 'src/c/hess.c' || echo '$(srcdir)/'`src/c/hess.c
 
 libscilinear_algebra_algo_la-eigen.lo: src/c/eigen.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-eigen.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-eigen.Tpo -c -o libscilinear_algebra_algo_la-eigen.lo `test -f 'src/c/eigen.c' || echo '$(srcdir)/'`src/c/eigen.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-eigen.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-eigen.Tpo -c -o libscilinear_algebra_algo_la-eigen.lo `test -f 'src/c/eigen.c' || echo '$(srcdir)/'`src/c/eigen.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-eigen.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-eigen.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/eigen.c' object='libscilinear_algebra_algo_la-eigen.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-eigen.lo `test -f 'src/c/eigen.c' || echo '$(srcdir)/'`src/c/eigen.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-eigen.lo `test -f 'src/c/eigen.c' || echo '$(srcdir)/'`src/c/eigen.c
 
 libscilinear_algebra_algo_la-balanc.lo: src/c/balanc.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-balanc.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-balanc.Tpo -c -o libscilinear_algebra_algo_la-balanc.lo `test -f 'src/c/balanc.c' || echo '$(srcdir)/'`src/c/balanc.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-balanc.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-balanc.Tpo -c -o libscilinear_algebra_algo_la-balanc.lo `test -f 'src/c/balanc.c' || echo '$(srcdir)/'`src/c/balanc.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-balanc.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-balanc.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/balanc.c' object='libscilinear_algebra_algo_la-balanc.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-balanc.lo `test -f 'src/c/balanc.c' || echo '$(srcdir)/'`src/c/balanc.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-balanc.lo `test -f 'src/c/balanc.c' || echo '$(srcdir)/'`src/c/balanc.c
 
 libscilinear_algebra_algo_la-chol.lo: src/c/chol.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-chol.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-chol.Tpo -c -o libscilinear_algebra_algo_la-chol.lo `test -f 'src/c/chol.c' || echo '$(srcdir)/'`src/c/chol.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-chol.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-chol.Tpo -c -o libscilinear_algebra_algo_la-chol.lo `test -f 'src/c/chol.c' || echo '$(srcdir)/'`src/c/chol.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-chol.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-chol.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/chol.c' object='libscilinear_algebra_algo_la-chol.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-chol.lo `test -f 'src/c/chol.c' || echo '$(srcdir)/'`src/c/chol.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-chol.lo `test -f 'src/c/chol.c' || echo '$(srcdir)/'`src/c/chol.c
 
 libscilinear_algebra_algo_la-svd.lo: src/c/svd.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-svd.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-svd.Tpo -c -o libscilinear_algebra_algo_la-svd.lo `test -f 'src/c/svd.c' || echo '$(srcdir)/'`src/c/svd.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-svd.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-svd.Tpo -c -o libscilinear_algebra_algo_la-svd.lo `test -f 'src/c/svd.c' || echo '$(srcdir)/'`src/c/svd.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-svd.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-svd.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/svd.c' object='libscilinear_algebra_algo_la-svd.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-svd.lo `test -f 'src/c/svd.c' || echo '$(srcdir)/'`src/c/svd.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-svd.lo `test -f 'src/c/svd.c' || echo '$(srcdir)/'`src/c/svd.c
 
 libscilinear_algebra_algo_la-rcond.lo: src/c/rcond.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-rcond.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-rcond.Tpo -c -o libscilinear_algebra_algo_la-rcond.lo `test -f 'src/c/rcond.c' || echo '$(srcdir)/'`src/c/rcond.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-rcond.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-rcond.Tpo -c -o libscilinear_algebra_algo_la-rcond.lo `test -f 'src/c/rcond.c' || echo '$(srcdir)/'`src/c/rcond.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-rcond.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-rcond.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/rcond.c' object='libscilinear_algebra_algo_la-rcond.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-rcond.lo `test -f 'src/c/rcond.c' || echo '$(srcdir)/'`src/c/rcond.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-rcond.lo `test -f 'src/c/rcond.c' || echo '$(srcdir)/'`src/c/rcond.c
 
 libscilinear_algebra_algo_la-det.lo: src/c/det.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-det.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-det.Tpo -c -o libscilinear_algebra_algo_la-det.lo `test -f 'src/c/det.c' || echo '$(srcdir)/'`src/c/det.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-det.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-det.Tpo -c -o libscilinear_algebra_algo_la-det.lo `test -f 'src/c/det.c' || echo '$(srcdir)/'`src/c/det.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-det.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-det.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/det.c' object='libscilinear_algebra_algo_la-det.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-det.lo `test -f 'src/c/det.c' || echo '$(srcdir)/'`src/c/det.c
-
-libscilinear_algebra_algo_la-schur.lo: src/c/schur.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-schur.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-schur.Tpo -c -o libscilinear_algebra_algo_la-schur.lo `test -f 'src/c/schur.c' || echo '$(srcdir)/'`src/c/schur.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-schur.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-schur.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/schur.c' object='libscilinear_algebra_algo_la-schur.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-schur.lo `test -f 'src/c/schur.c' || echo '$(srcdir)/'`src/c/schur.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-det.lo `test -f 'src/c/det.c' || echo '$(srcdir)/'`src/c/det.c
 
 libscilinear_algebra_algo_la-lsq.lo: src/c/lsq.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-lsq.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-lsq.Tpo -c -o libscilinear_algebra_algo_la-lsq.lo `test -f 'src/c/lsq.c' || echo '$(srcdir)/'`src/c/lsq.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-lsq.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-lsq.Tpo -c -o libscilinear_algebra_algo_la-lsq.lo `test -f 'src/c/lsq.c' || echo '$(srcdir)/'`src/c/lsq.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-lsq.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-lsq.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/lsq.c' object='libscilinear_algebra_algo_la-lsq.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-lsq.lo `test -f 'src/c/lsq.c' || echo '$(srcdir)/'`src/c/lsq.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-lsq.lo `test -f 'src/c/lsq.c' || echo '$(srcdir)/'`src/c/lsq.c
 
 libscilinear_algebra_algo_la-issymmetric.lo: src/c/issymmetric.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-issymmetric.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-issymmetric.Tpo -c -o libscilinear_algebra_algo_la-issymmetric.lo `test -f 'src/c/issymmetric.c' || echo '$(srcdir)/'`src/c/issymmetric.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_algo_la-issymmetric.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-issymmetric.Tpo -c -o libscilinear_algebra_algo_la-issymmetric.lo `test -f 'src/c/issymmetric.c' || echo '$(srcdir)/'`src/c/issymmetric.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-issymmetric.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-issymmetric.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/issymmetric.c' object='libscilinear_algebra_algo_la-issymmetric.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) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-issymmetric.lo `test -f 'src/c/issymmetric.c' || echo '$(srcdir)/'`src/c/issymmetric.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_algo_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_algo_la-issymmetric.lo `test -f 'src/c/issymmetric.c' || echo '$(srcdir)/'`src/c/issymmetric.c
 
 libscilinear_algebra_la-sci_backslash.lo: sci_gateway/c/sci_backslash.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_backslash.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_backslash.Tpo -c -o libscilinear_algebra_la-sci_backslash.lo `test -f 'sci_gateway/c/sci_backslash.c' || echo '$(srcdir)/'`sci_gateway/c/sci_backslash.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_backslash.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_backslash.Tpo -c -o libscilinear_algebra_la-sci_backslash.lo `test -f 'sci_gateway/c/sci_backslash.c' || echo '$(srcdir)/'`sci_gateway/c/sci_backslash.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_backslash.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_backslash.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_backslash.c' object='libscilinear_algebra_la-sci_backslash.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_backslash.lo `test -f 'sci_gateway/c/sci_backslash.c' || echo '$(srcdir)/'`sci_gateway/c/sci_backslash.c
-
-libscilinear_algebra_la-sci_hess.lo: sci_gateway/c/sci_hess.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_hess.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_hess.Tpo -c -o libscilinear_algebra_la-sci_hess.lo `test -f 'sci_gateway/c/sci_hess.c' || echo '$(srcdir)/'`sci_gateway/c/sci_hess.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_hess.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_hess.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_hess.c' object='libscilinear_algebra_la-sci_hess.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_hess.lo `test -f 'sci_gateway/c/sci_hess.c' || echo '$(srcdir)/'`sci_gateway/c/sci_hess.c
-
-libscilinear_algebra_la-sci_rcond.lo: sci_gateway/c/sci_rcond.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_rcond.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_rcond.Tpo -c -o libscilinear_algebra_la-sci_rcond.lo `test -f 'sci_gateway/c/sci_rcond.c' || echo '$(srcdir)/'`sci_gateway/c/sci_rcond.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_rcond.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_rcond.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_rcond.c' object='libscilinear_algebra_la-sci_rcond.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_rcond.lo `test -f 'sci_gateway/c/sci_rcond.c' || echo '$(srcdir)/'`sci_gateway/c/sci_rcond.c
-
-libscilinear_algebra_la-sci_bdiag.lo: sci_gateway/c/sci_bdiag.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_bdiag.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_bdiag.Tpo -c -o libscilinear_algebra_la-sci_bdiag.lo `test -f 'sci_gateway/c/sci_bdiag.c' || echo '$(srcdir)/'`sci_gateway/c/sci_bdiag.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_bdiag.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_bdiag.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_bdiag.c' object='libscilinear_algebra_la-sci_bdiag.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_bdiag.lo `test -f 'sci_gateway/c/sci_bdiag.c' || echo '$(srcdir)/'`sci_gateway/c/sci_bdiag.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_backslash.lo `test -f 'sci_gateway/c/sci_backslash.c' || echo '$(srcdir)/'`sci_gateway/c/sci_backslash.c
 
 libscilinear_algebra_la-sci_slash.lo: sci_gateway/c/sci_slash.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_slash.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_slash.Tpo -c -o libscilinear_algebra_la-sci_slash.lo `test -f 'sci_gateway/c/sci_slash.c' || echo '$(srcdir)/'`sci_gateway/c/sci_slash.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_slash.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_slash.Tpo -c -o libscilinear_algebra_la-sci_slash.lo `test -f 'sci_gateway/c/sci_slash.c' || echo '$(srcdir)/'`sci_gateway/c/sci_slash.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_slash.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_slash.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_slash.c' object='libscilinear_algebra_la-sci_slash.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_slash.lo `test -f 'sci_gateway/c/sci_slash.c' || echo '$(srcdir)/'`sci_gateway/c/sci_slash.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_slash.lo `test -f 'sci_gateway/c/sci_slash.c' || echo '$(srcdir)/'`sci_gateway/c/sci_slash.c
 
 libscilinear_algebra_la-gw_linear_algebra2.lo: sci_gateway/c/gw_linear_algebra2.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-gw_linear_algebra2.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra2.Tpo -c -o libscilinear_algebra_la-gw_linear_algebra2.lo `test -f 'sci_gateway/c/gw_linear_algebra2.c' || echo '$(srcdir)/'`sci_gateway/c/gw_linear_algebra2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-gw_linear_algebra2.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra2.Tpo -c -o libscilinear_algebra_la-gw_linear_algebra2.lo `test -f 'sci_gateway/c/gw_linear_algebra2.c' || echo '$(srcdir)/'`sci_gateway/c/gw_linear_algebra2.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra2.Tpo $(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra2.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/gw_linear_algebra2.c' object='libscilinear_algebra_la-gw_linear_algebra2.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-gw_linear_algebra2.lo `test -f 'sci_gateway/c/gw_linear_algebra2.c' || echo '$(srcdir)/'`sci_gateway/c/gw_linear_algebra2.c
-
-libscilinear_algebra_la-sci_det.lo: sci_gateway/c/sci_det.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_det.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_det.Tpo -c -o libscilinear_algebra_la-sci_det.lo `test -f 'sci_gateway/c/sci_det.c' || echo '$(srcdir)/'`sci_gateway/c/sci_det.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_det.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_det.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_det.c' object='libscilinear_algebra_la-sci_det.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_det.lo `test -f 'sci_gateway/c/sci_det.c' || echo '$(srcdir)/'`sci_gateway/c/sci_det.c
-
-libscilinear_algebra_la-sci_lu.lo: sci_gateway/c/sci_lu.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_lu.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_lu.Tpo -c -o libscilinear_algebra_la-sci_lu.lo `test -f 'sci_gateway/c/sci_lu.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lu.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_lu.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_lu.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_lu.c' object='libscilinear_algebra_la-sci_lu.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_lu.lo `test -f 'sci_gateway/c/sci_lu.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lu.c
-
-libscilinear_algebra_la-sci_balanc.lo: sci_gateway/c/sci_balanc.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_balanc.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_balanc.Tpo -c -o libscilinear_algebra_la-sci_balanc.lo `test -f 'sci_gateway/c/sci_balanc.c' || echo '$(srcdir)/'`sci_gateway/c/sci_balanc.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_balanc.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_balanc.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_balanc.c' object='libscilinear_algebra_la-sci_balanc.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_balanc.lo `test -f 'sci_gateway/c/sci_balanc.c' || echo '$(srcdir)/'`sci_gateway/c/sci_balanc.c
-
-libscilinear_algebra_la-sci_qr.lo: sci_gateway/c/sci_qr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_qr.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_qr.Tpo -c -o libscilinear_algebra_la-sci_qr.lo `test -f 'sci_gateway/c/sci_qr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_qr.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_qr.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_qr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_qr.c' object='libscilinear_algebra_la-sci_qr.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_qr.lo `test -f 'sci_gateway/c/sci_qr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_qr.c
-
-libscilinear_algebra_la-sci_schur.lo: sci_gateway/c/sci_schur.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_schur.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_schur.Tpo -c -o libscilinear_algebra_la-sci_schur.lo `test -f 'sci_gateway/c/sci_schur.c' || echo '$(srcdir)/'`sci_gateway/c/sci_schur.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_schur.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_schur.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_schur.c' object='libscilinear_algebra_la-sci_schur.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_schur.lo `test -f 'sci_gateway/c/sci_schur.c' || echo '$(srcdir)/'`sci_gateway/c/sci_schur.c
-
-libscilinear_algebra_la-sci_chol.lo: sci_gateway/c/sci_chol.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_chol.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_chol.Tpo -c -o libscilinear_algebra_la-sci_chol.lo `test -f 'sci_gateway/c/sci_chol.c' || echo '$(srcdir)/'`sci_gateway/c/sci_chol.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_chol.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_chol.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_chol.c' object='libscilinear_algebra_la-sci_chol.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_chol.lo `test -f 'sci_gateway/c/sci_chol.c' || echo '$(srcdir)/'`sci_gateway/c/sci_chol.c
-
-libscilinear_algebra_la-sci_eig.lo: sci_gateway/c/sci_eig.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_eig.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_eig.Tpo -c -o libscilinear_algebra_la-sci_eig.lo `test -f 'sci_gateway/c/sci_eig.c' || echo '$(srcdir)/'`sci_gateway/c/sci_eig.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_eig.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_eig.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_eig.c' object='libscilinear_algebra_la-sci_eig.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_eig.lo `test -f 'sci_gateway/c/sci_eig.c' || echo '$(srcdir)/'`sci_gateway/c/sci_eig.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-gw_linear_algebra2.lo `test -f 'sci_gateway/c/gw_linear_algebra2.c' || echo '$(srcdir)/'`sci_gateway/c/gw_linear_algebra2.c
 
 libscilinear_algebra_la-gw_linear_algebra.lo: sci_gateway/c/gw_linear_algebra.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-gw_linear_algebra.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra.Tpo -c -o libscilinear_algebra_la-gw_linear_algebra.lo `test -f 'sci_gateway/c/gw_linear_algebra.c' || echo '$(srcdir)/'`sci_gateway/c/gw_linear_algebra.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-gw_linear_algebra.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra.Tpo -c -o libscilinear_algebra_la-gw_linear_algebra.lo `test -f 'sci_gateway/c/gw_linear_algebra.c' || echo '$(srcdir)/'`sci_gateway/c/gw_linear_algebra.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra.Tpo $(DEPDIR)/libscilinear_algebra_la-gw_linear_algebra.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/gw_linear_algebra.c' object='libscilinear_algebra_la-gw_linear_algebra.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-gw_linear_algebra.lo `test -f 'sci_gateway/c/gw_linear_algebra.c' || echo '$(srcdir)/'`sci_gateway/c/gw_linear_algebra.c
-
-libscilinear_algebra_la-sci_inv.lo: sci_gateway/c/sci_inv.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_inv.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_inv.Tpo -c -o libscilinear_algebra_la-sci_inv.lo `test -f 'sci_gateway/c/sci_inv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_inv.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_inv.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_inv.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_inv.c' object='libscilinear_algebra_la-sci_inv.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_inv.lo `test -f 'sci_gateway/c/sci_inv.c' || echo '$(srcdir)/'`sci_gateway/c/sci_inv.c
-
-libscilinear_algebra_la-sci_svd.lo: sci_gateway/c/sci_svd.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_svd.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_svd.Tpo -c -o libscilinear_algebra_la-sci_svd.lo `test -f 'sci_gateway/c/sci_svd.c' || echo '$(srcdir)/'`sci_gateway/c/sci_svd.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_svd.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_svd.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_svd.c' object='libscilinear_algebra_la-sci_svd.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_svd.lo `test -f 'sci_gateway/c/sci_svd.c' || echo '$(srcdir)/'`sci_gateway/c/sci_svd.c
-
-libscilinear_algebra_la-sci_lsq.lo: sci_gateway/c/sci_lsq.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_lsq.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_lsq.Tpo -c -o libscilinear_algebra_la-sci_lsq.lo `test -f 'sci_gateway/c/sci_lsq.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lsq.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_lsq.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_lsq.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_lsq.c' object='libscilinear_algebra_la-sci_lsq.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_lsq.lo `test -f 'sci_gateway/c/sci_lsq.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lsq.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-gw_linear_algebra.lo `test -f 'sci_gateway/c/gw_linear_algebra.c' || echo '$(srcdir)/'`sci_gateway/c/gw_linear_algebra.c
 
 libscilinear_algebra_la-assembleEigenvectors.lo: sci_gateway/c/assembleEigenvectors.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-assembleEigenvectors.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-assembleEigenvectors.Tpo -c -o libscilinear_algebra_la-assembleEigenvectors.lo `test -f 'sci_gateway/c/assembleEigenvectors.c' || echo '$(srcdir)/'`sci_gateway/c/assembleEigenvectors.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-assembleEigenvectors.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-assembleEigenvectors.Tpo -c -o libscilinear_algebra_la-assembleEigenvectors.lo `test -f 'sci_gateway/c/assembleEigenvectors.c' || echo '$(srcdir)/'`sci_gateway/c/assembleEigenvectors.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-assembleEigenvectors.Tpo $(DEPDIR)/libscilinear_algebra_la-assembleEigenvectors.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/assembleEigenvectors.c' object='libscilinear_algebra_la-assembleEigenvectors.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-assembleEigenvectors.lo `test -f 'sci_gateway/c/assembleEigenvectors.c' || echo '$(srcdir)/'`sci_gateway/c/assembleEigenvectors.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-assembleEigenvectors.lo `test -f 'sci_gateway/c/assembleEigenvectors.c' || echo '$(srcdir)/'`sci_gateway/c/assembleEigenvectors.c
 
 libscilinear_algebra_la-sci_dgeev.lo: sci_gateway/c/sci_dgeev.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_dgeev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_dgeev.Tpo -c -o libscilinear_algebra_la-sci_dgeev.lo `test -f 'sci_gateway/c/sci_dgeev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dgeev.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_dgeev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_dgeev.Tpo -c -o libscilinear_algebra_la-sci_dgeev.lo `test -f 'sci_gateway/c/sci_dgeev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dgeev.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_dgeev.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_dgeev.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_dgeev.c' object='libscilinear_algebra_la-sci_dgeev.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_dgeev.lo `test -f 'sci_gateway/c/sci_dgeev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dgeev.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_dgeev.lo `test -f 'sci_gateway/c/sci_dgeev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dgeev.c
 
 libscilinear_algebra_la-sci_dggev.lo: sci_gateway/c/sci_dggev.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_dggev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_dggev.Tpo -c -o libscilinear_algebra_la-sci_dggev.lo `test -f 'sci_gateway/c/sci_dggev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dggev.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_dggev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_dggev.Tpo -c -o libscilinear_algebra_la-sci_dggev.lo `test -f 'sci_gateway/c/sci_dggev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dggev.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_dggev.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_dggev.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_dggev.c' object='libscilinear_algebra_la-sci_dggev.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_dggev.lo `test -f 'sci_gateway/c/sci_dggev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dggev.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_dggev.lo `test -f 'sci_gateway/c/sci_dggev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dggev.c
 
 libscilinear_algebra_la-sci_dsyev.lo: sci_gateway/c/sci_dsyev.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_dsyev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_dsyev.Tpo -c -o libscilinear_algebra_la-sci_dsyev.lo `test -f 'sci_gateway/c/sci_dsyev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dsyev.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_dsyev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_dsyev.Tpo -c -o libscilinear_algebra_la-sci_dsyev.lo `test -f 'sci_gateway/c/sci_dsyev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dsyev.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_dsyev.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_dsyev.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_dsyev.c' object='libscilinear_algebra_la-sci_dsyev.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_dsyev.lo `test -f 'sci_gateway/c/sci_dsyev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dsyev.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_dsyev.lo `test -f 'sci_gateway/c/sci_dsyev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_dsyev.c
 
 libscilinear_algebra_la-sci_zgeev.lo: sci_gateway/c/sci_zgeev.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_zgeev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_zgeev.Tpo -c -o libscilinear_algebra_la-sci_zgeev.lo `test -f 'sci_gateway/c/sci_zgeev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zgeev.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_zgeev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_zgeev.Tpo -c -o libscilinear_algebra_la-sci_zgeev.lo `test -f 'sci_gateway/c/sci_zgeev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zgeev.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_zgeev.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_zgeev.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_zgeev.c' object='libscilinear_algebra_la-sci_zgeev.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_zgeev.lo `test -f 'sci_gateway/c/sci_zgeev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zgeev.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_zgeev.lo `test -f 'sci_gateway/c/sci_zgeev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zgeev.c
 
 libscilinear_algebra_la-sci_zggev.lo: sci_gateway/c/sci_zggev.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_zggev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_zggev.Tpo -c -o libscilinear_algebra_la-sci_zggev.lo `test -f 'sci_gateway/c/sci_zggev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zggev.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_zggev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_zggev.Tpo -c -o libscilinear_algebra_la-sci_zggev.lo `test -f 'sci_gateway/c/sci_zggev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zggev.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_zggev.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_zggev.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_zggev.c' object='libscilinear_algebra_la-sci_zggev.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_zggev.lo `test -f 'sci_gateway/c/sci_zggev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zggev.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_zggev.lo `test -f 'sci_gateway/c/sci_zggev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zggev.c
 
 libscilinear_algebra_la-sci_zheev.lo: sci_gateway/c/sci_zheev.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_zheev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_zheev.Tpo -c -o libscilinear_algebra_la-sci_zheev.lo `test -f 'sci_gateway/c/sci_zheev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zheev.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -MT libscilinear_algebra_la-sci_zheev.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_zheev.Tpo -c -o libscilinear_algebra_la-sci_zheev.lo `test -f 'sci_gateway/c/sci_zheev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zheev.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_zheev.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_zheev.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_zheev.c' object='libscilinear_algebra_la-sci_zheev.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) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_zheev.lo `test -f 'sci_gateway/c/sci_zheev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zheev.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(libscilinear_algebra_la_CFLAGS) $(CFLAGS) -c -o libscilinear_algebra_la-sci_zheev.lo `test -f 'sci_gateway/c/sci_zheev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_zheev.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 $@ $<
+
+libscilinear_algebra_algo_la-scischur.lo: src/cpp/scischur.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_algo_la-scischur.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-scischur.Tpo -c -o libscilinear_algebra_algo_la-scischur.lo `test -f 'src/cpp/scischur.cpp' || echo '$(srcdir)/'`src/cpp/scischur.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-scischur.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-scischur.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/scischur.cpp' object='libscilinear_algebra_algo_la-scischur.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) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_algo_la-scischur.lo `test -f 'src/cpp/scischur.cpp' || echo '$(srcdir)/'`src/cpp/scischur.cpp
+
+libscilinear_algebra_algo_la-schurSelect.lo: src/cpp/schurSelect.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_algo_la-schurSelect.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_algo_la-schurSelect.Tpo -c -o libscilinear_algebra_algo_la-schurSelect.lo `test -f 'src/cpp/schurSelect.cpp' || echo '$(srcdir)/'`src/cpp/schurSelect.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_algo_la-schurSelect.Tpo $(DEPDIR)/libscilinear_algebra_algo_la-schurSelect.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/schurSelect.cpp' object='libscilinear_algebra_algo_la-schurSelect.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) $(libscilinear_algebra_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_algo_la-schurSelect.lo `test -f 'src/cpp/schurSelect.cpp' || echo '$(srcdir)/'`src/cpp/schurSelect.cpp
+
+libscilinear_algebra_la-linear_algebra_gw.lo: sci_gateway/cpp/linear_algebra_gw.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-linear_algebra_gw.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-linear_algebra_gw.Tpo -c -o libscilinear_algebra_la-linear_algebra_gw.lo `test -f 'sci_gateway/cpp/linear_algebra_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/linear_algebra_gw.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-linear_algebra_gw.Tpo $(DEPDIR)/libscilinear_algebra_la-linear_algebra_gw.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/linear_algebra_gw.cpp' object='libscilinear_algebra_la-linear_algebra_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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-linear_algebra_gw.lo `test -f 'sci_gateway/cpp/linear_algebra_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/linear_algebra_gw.cpp
+
+libscilinear_algebra_la-sci_chol.lo: sci_gateway/cpp/sci_chol.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_chol.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_chol.Tpo -c -o libscilinear_algebra_la-sci_chol.lo `test -f 'sci_gateway/cpp/sci_chol.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_chol.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_chol.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_chol.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_chol.cpp' object='libscilinear_algebra_la-sci_chol.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_chol.lo `test -f 'sci_gateway/cpp/sci_chol.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_chol.cpp
+
+libscilinear_algebra_la-sci_bdiag.lo: sci_gateway/cpp/sci_bdiag.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_bdiag.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_bdiag.Tpo -c -o libscilinear_algebra_la-sci_bdiag.lo `test -f 'sci_gateway/cpp/sci_bdiag.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_bdiag.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_bdiag.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_bdiag.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_bdiag.cpp' object='libscilinear_algebra_la-sci_bdiag.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_bdiag.lo `test -f 'sci_gateway/cpp/sci_bdiag.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_bdiag.cpp
+
+libscilinear_algebra_la-sci_inv.lo: sci_gateway/cpp/sci_inv.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_inv.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_inv.Tpo -c -o libscilinear_algebra_la-sci_inv.lo `test -f 'sci_gateway/cpp/sci_inv.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_inv.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_inv.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_inv.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_inv.cpp' object='libscilinear_algebra_la-sci_inv.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_inv.lo `test -f 'sci_gateway/cpp/sci_inv.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_inv.cpp
+
+libscilinear_algebra_la-sci_svd.lo: sci_gateway/cpp/sci_svd.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_svd.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_svd.Tpo -c -o libscilinear_algebra_la-sci_svd.lo `test -f 'sci_gateway/cpp/sci_svd.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_svd.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_svd.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_svd.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_svd.cpp' object='libscilinear_algebra_la-sci_svd.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_svd.lo `test -f 'sci_gateway/cpp/sci_svd.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_svd.cpp
+
+libscilinear_algebra_la-sci_rcond.lo: sci_gateway/cpp/sci_rcond.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_rcond.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_rcond.Tpo -c -o libscilinear_algebra_la-sci_rcond.lo `test -f 'sci_gateway/cpp/sci_rcond.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_rcond.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_rcond.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_rcond.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_rcond.cpp' object='libscilinear_algebra_la-sci_rcond.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_rcond.lo `test -f 'sci_gateway/cpp/sci_rcond.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_rcond.cpp
+
+libscilinear_algebra_la-sci_qr.lo: sci_gateway/cpp/sci_qr.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_qr.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_qr.Tpo -c -o libscilinear_algebra_la-sci_qr.lo `test -f 'sci_gateway/cpp/sci_qr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_qr.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_qr.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_qr.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_qr.cpp' object='libscilinear_algebra_la-sci_qr.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_qr.lo `test -f 'sci_gateway/cpp/sci_qr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_qr.cpp
+
+libscilinear_algebra_la-sci_lu.lo: sci_gateway/cpp/sci_lu.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_lu.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_lu.Tpo -c -o libscilinear_algebra_la-sci_lu.lo `test -f 'sci_gateway/cpp/sci_lu.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_lu.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_lu.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_lu.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_lu.cpp' object='libscilinear_algebra_la-sci_lu.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_lu.lo `test -f 'sci_gateway/cpp/sci_lu.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_lu.cpp
+
+libscilinear_algebra_la-sci_lsq.lo: sci_gateway/cpp/sci_lsq.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_lsq.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_lsq.Tpo -c -o libscilinear_algebra_la-sci_lsq.lo `test -f 'sci_gateway/cpp/sci_lsq.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_lsq.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_lsq.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_lsq.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_lsq.cpp' object='libscilinear_algebra_la-sci_lsq.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_lsq.lo `test -f 'sci_gateway/cpp/sci_lsq.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_lsq.cpp
+
+libscilinear_algebra_la-sci_hess.lo: sci_gateway/cpp/sci_hess.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_hess.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_hess.Tpo -c -o libscilinear_algebra_la-sci_hess.lo `test -f 'sci_gateway/cpp/sci_hess.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_hess.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_hess.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_hess.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_hess.cpp' object='libscilinear_algebra_la-sci_hess.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_hess.lo `test -f 'sci_gateway/cpp/sci_hess.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_hess.cpp
+
+libscilinear_algebra_la-sci_spec.lo: sci_gateway/cpp/sci_spec.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_spec.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_spec.Tpo -c -o libscilinear_algebra_la-sci_spec.lo `test -f 'sci_gateway/cpp/sci_spec.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_spec.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_spec.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_spec.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_spec.cpp' object='libscilinear_algebra_la-sci_spec.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_spec.lo `test -f 'sci_gateway/cpp/sci_spec.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_spec.cpp
+
+libscilinear_algebra_la-sci_det.lo: sci_gateway/cpp/sci_det.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_det.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_det.Tpo -c -o libscilinear_algebra_la-sci_det.lo `test -f 'sci_gateway/cpp/sci_det.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_det.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_det.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_det.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_det.cpp' object='libscilinear_algebra_la-sci_det.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_det.lo `test -f 'sci_gateway/cpp/sci_det.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_det.cpp
+
+libscilinear_algebra_la-sci_balanc.lo: sci_gateway/cpp/sci_balanc.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_balanc.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_balanc.Tpo -c -o libscilinear_algebra_la-sci_balanc.lo `test -f 'sci_gateway/cpp/sci_balanc.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_balanc.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_balanc.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_balanc.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_balanc.cpp' object='libscilinear_algebra_la-sci_balanc.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_balanc.lo `test -f 'sci_gateway/cpp/sci_balanc.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_balanc.cpp
+
+libscilinear_algebra_la-sci_schur.lo: sci_gateway/cpp/sci_schur.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscilinear_algebra_la-sci_schur.lo -MD -MP -MF $(DEPDIR)/libscilinear_algebra_la-sci_schur.Tpo -c -o libscilinear_algebra_la-sci_schur.lo `test -f 'sci_gateway/cpp/sci_schur.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_schur.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscilinear_algebra_la-sci_schur.Tpo $(DEPDIR)/libscilinear_algebra_la-sci_schur.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_schur.cpp' object='libscilinear_algebra_la-sci_schur.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) $(libscilinear_algebra_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscilinear_algebra_la-sci_schur.lo `test -f 'sci_gateway/cpp/sci_schur.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_schur.cpp
 
 .f.o:
        $(F77COMPILE) -c -o $@ $<
@@ -1088,18 +1137,9 @@ intzgehrd.lo: src/fortran/intzgehrd.f
 intzgesvd1.lo: src/fortran/intzgesvd1.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgesvd1.lo `test -f 'src/fortran/intzgesvd1.f' || echo '$(srcdir)/'`src/fortran/intzgesvd1.f
 
-intzfschur.lo: src/fortran/intzfschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzfschur.lo `test -f 'src/fortran/intzfschur.f' || echo '$(srcdir)/'`src/fortran/intzfschur.f
-
 intzgesvd2.lo: src/fortran/intzgesvd2.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgesvd2.lo `test -f 'src/fortran/intzgesvd2.f' || echo '$(srcdir)/'`src/fortran/intzgesvd2.f
 
-intdgges.lo: src/fortran/intdgges.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgges.lo `test -f 'src/fortran/intdgges.f' || echo '$(srcdir)/'`src/fortran/intdgges.f
-
-intgschur.lo: src/fortran/intgschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intgschur.lo `test -f 'src/fortran/intgschur.f' || echo '$(srcdir)/'`src/fortran/intgschur.f
-
 intdgesv3.lo: src/fortran/intdgesv3.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgesv3.lo `test -f 'src/fortran/intdgesv3.f' || echo '$(srcdir)/'`src/fortran/intdgesv3.f
 
@@ -1109,9 +1149,6 @@ intdgesv4.lo: src/fortran/intdgesv4.f
 DGELSY1.lo: src/fortran/DGELSY1.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o DGELSY1.lo `test -f 'src/fortran/DGELSY1.f' || echo '$(srcdir)/'`src/fortran/DGELSY1.f
 
-intozgschur.lo: src/fortran/intozgschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intozgschur.lo `test -f 'src/fortran/intozgschur.f' || echo '$(srcdir)/'`src/fortran/intozgschur.f
-
 intdpotrf.lo: src/fortran/intdpotrf.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdpotrf.lo `test -f 'src/fortran/intdpotrf.f' || echo '$(srcdir)/'`src/fortran/intdpotrf.f
 
@@ -1127,9 +1164,6 @@ zoldqr.lo: src/fortran/zoldqr.f
 intzgetrf.lo: src/fortran/intzgetrf.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgetrf.lo `test -f 'src/fortran/intzgetrf.f' || echo '$(srcdir)/'`src/fortran/intzgetrf.f
 
-intoschur.lo: src/fortran/intoschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intoschur.lo `test -f 'src/fortran/intoschur.f' || echo '$(srcdir)/'`src/fortran/intoschur.f
-
 complexify.lo: src/fortran/complexify.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o complexify.lo `test -f 'src/fortran/complexify.f' || echo '$(srcdir)/'`src/fortran/complexify.f
 
@@ -1142,18 +1176,6 @@ intzgetri.lo: src/fortran/intzgetri.f
 intzggbal.lo: src/fortran/intzggbal.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzggbal.lo `test -f 'src/fortran/intzggbal.f' || echo '$(srcdir)/'`src/fortran/intzggbal.f
 
-intdgees0.lo: src/fortran/intdgees0.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgees0.lo `test -f 'src/fortran/intdgees0.f' || echo '$(srcdir)/'`src/fortran/intdgees0.f
-
-intdgees1.lo: src/fortran/intdgees1.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgees1.lo `test -f 'src/fortran/intdgees1.f' || echo '$(srcdir)/'`src/fortran/intdgees1.f
-
-intogschur.lo: src/fortran/intogschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intogschur.lo `test -f 'src/fortran/intogschur.f' || echo '$(srcdir)/'`src/fortran/intogschur.f
-
-intzgges.lo: src/fortran/intzgges.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgges.lo `test -f 'src/fortran/intzgges.f' || echo '$(srcdir)/'`src/fortran/intzgges.f
-
 intddet.lo: src/fortran/intddet.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intddet.lo `test -f 'src/fortran/intddet.f' || echo '$(srcdir)/'`src/fortran/intddet.f
 
@@ -1169,9 +1191,6 @@ intzpotrf.lo: src/fortran/intzpotrf.f
 intzgecon.lo: src/fortran/intzgecon.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgecon.lo `test -f 'src/fortran/intzgecon.f' || echo '$(srcdir)/'`src/fortran/intzgecon.f
 
-intzgschur.lo: src/fortran/intzgschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgschur.lo `test -f 'src/fortran/intzgschur.f' || echo '$(srcdir)/'`src/fortran/intzgschur.f
-
 intzoldsvd.lo: src/fortran/intzoldsvd.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzoldsvd.lo `test -f 'src/fortran/intzoldsvd.f' || echo '$(srcdir)/'`src/fortran/intzoldsvd.f
 
@@ -1181,9 +1200,6 @@ intdgelsy.lo: src/fortran/intdgelsy.f
 intdgeqpf3.lo: src/fortran/intdgeqpf3.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgeqpf3.lo `test -f 'src/fortran/intdgeqpf3.f' || echo '$(srcdir)/'`src/fortran/intdgeqpf3.f
 
-intfschur.lo: src/fortran/intfschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intfschur.lo `test -f 'src/fortran/intfschur.f' || echo '$(srcdir)/'`src/fortran/intfschur.f
-
 intdgeqpf4.lo: src/fortran/intdgeqpf4.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgeqpf4.lo `test -f 'src/fortran/intdgeqpf4.f' || echo '$(srcdir)/'`src/fortran/intdgeqpf4.f
 
@@ -1193,24 +1209,15 @@ intdgesvd1.lo: src/fortran/intdgesvd1.f
 intdgehrd.lo: src/fortran/intdgehrd.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgehrd.lo `test -f 'src/fortran/intdgehrd.f' || echo '$(srcdir)/'`src/fortran/intdgehrd.f
 
-intzgees0.lo: src/fortran/intzgees0.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgees0.lo `test -f 'src/fortran/intzgees0.f' || echo '$(srcdir)/'`src/fortran/intzgees0.f
-
 intdgesvd2.lo: src/fortran/intdgesvd2.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgesvd2.lo `test -f 'src/fortran/intdgesvd2.f' || echo '$(srcdir)/'`src/fortran/intdgesvd2.f
 
-intzgees1.lo: src/fortran/intzgees1.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgees1.lo `test -f 'src/fortran/intzgees1.f' || echo '$(srcdir)/'`src/fortran/intzgees1.f
-
 intzdet.lo: src/fortran/intzdet.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzdet.lo `test -f 'src/fortran/intzdet.f' || echo '$(srcdir)/'`src/fortran/intzdet.f
 
 doldqr.lo: src/fortran/doldqr.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o doldqr.lo `test -f 'src/fortran/doldqr.f' || echo '$(srcdir)/'`src/fortran/doldqr.f
 
-scischur.lo: src/fortran/scischur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o scischur.lo `test -f 'src/fortran/scischur.f' || echo '$(srcdir)/'`src/fortran/scischur.f
-
 intdgetrf.lo: src/fortran/intdgetrf.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgetrf.lo `test -f 'src/fortran/intdgetrf.f' || echo '$(srcdir)/'`src/fortran/intdgetrf.f
 
@@ -1223,15 +1230,15 @@ intdgetri.lo: src/fortran/intdgetri.f
 intdgebal.lo: src/fortran/intdgebal.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intdgebal.lo `test -f 'src/fortran/intdgebal.f' || echo '$(srcdir)/'`src/fortran/intdgebal.f
 
-intzschur.lo: src/fortran/intzschur.f
-       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzschur.lo `test -f 'src/fortran/intzschur.f' || echo '$(srcdir)/'`src/fortran/intzschur.f
-
 intzgeqpf3.lo: src/fortran/intzgeqpf3.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzgeqpf3.lo `test -f 'src/fortran/intzgeqpf3.f' || echo '$(srcdir)/'`src/fortran/intzgeqpf3.f
 
 writebuf.lo: src/fortran/writebuf.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o writebuf.lo `test -f 'src/fortran/writebuf.f' || echo '$(srcdir)/'`src/fortran/writebuf.f
 
+intzschur.lo: src/fortran/intzschur.f
+       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o intzschur.lo `test -f 'src/fortran/intzschur.f' || echo '$(srcdir)/'`src/fortran/intzschur.f
+
 bschur.lo: sci_gateway/fortran/bschur.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o bschur.lo `test -f 'sci_gateway/fortran/bschur.f' || echo '$(srcdir)/'`sci_gateway/fortran/bschur.f
 
index f501306..fc1e188 100644 (file)
@@ -9,7 +9,7 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
-
+#include "dynlib_linear_algebra.h"
 /*
  * Implementation of Scilab balanc() function for one or two real or complex matrix (both must be of the same kind, either real or complex).
  * @param pData1 double* (or doublecomplex* disguised as double*, in fact) point to data of arg 1 matrix
@@ -23,4 +23,4 @@
  * @param lhsData1 double* data for LhsVar(Rhs+1)
  * @param lhsData2 double* data for LhsVar(4) if Rhs==2, NULL otherwise
  */
-int iBalancM(double* pData1, double* pData2, int iCols, int complexArgs, double* lhsData1, double* lhsData2);
+LINEAR_ALGEBRA_IMPEXP int iBalancM(double* pData1, double* pData2, int iCols, int complexArgs, double* lhsData1, double* lhsData2);
index 74ceff8..4000a20 100644 (file)
@@ -9,7 +9,8 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
+#include "doublecomplex.h"
+#include "dynlib_linear_algebra.h"
 
-
-extern int iRealCholProduct(double *_pdblReal, int _iLeadDim);
-extern int iComplexCholProduct(doublecomplex *_poIn, int _iLeadDim);
+LINEAR_ALGEBRA_IMPEXP int iRealCholProduct(double *_pdblReal, int _iLeadDim);
+LINEAR_ALGEBRA_IMPEXP int iComplexCholProduct(doublecomplex *_poIn, int _iLeadDim);
index 76b8c6b..8c054c5 100644 (file)
@@ -11,7 +11,7 @@
  */
 #ifndef DET_H
 #define DET_H
-
+#include "dynlib_linear_algebra.h"
 /*
  * computes the determinant of a real or complex square matrix, performing MALLOCation of temp variables as needed.
  * Cf. http://www.scilab.org/product/man/det.html
@@ -31,6 +31,6 @@
  *
  */
 
-int iDetM(double* pData, int iCols, double* pMantissaReal, double* pMantissaImg, int* piExponent);
+LINEAR_ALGEBRA_IMPEXP int iDetM(double* pData, int iCols, double* pMantissaReal, double* pMantissaImg, int* piExponent);
 
 #endif
diff --git a/scilab/modules/linear_algebra/includes/dynlib_linear_algebra_gw.h b/scilab/modules/linear_algebra/includes/dynlib_linear_algebra_gw.h
new file mode 100644 (file)
index 0000000..a225501
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+* 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_LINEAR_ALGEBRA_GW_H__
+#define __DYNLIB_LINEAR_ALGEBRA_GW_H__
+
+#ifdef _MSC_VER
+#ifdef LINEAR_ALGEBRA_EXPORTS_GW
+#define LINEAR_ALGEBRA_GW_IMPEXP __declspec(dllexport)
+#else
+#define LINEAR_ALGEBRA_GW_IMPEXP __declspec(dllimport)
+#endif
+#else
+#define LINEAR_ALGEBRA_GW_IMPEXP 
+#endif
+
+#endif /* __DYNLIB_HISTORY_MANAGER_GW_H__ */
+/*--------------------------------------------------------------------------*/ 
index 06a1229..41a5656 100644 (file)
@@ -13,7 +13,7 @@
 #define EIGEN_H
 
 #include "doublecomplex.h"
-
+#include "dynlib_linear_algebra.h"
 /*
  * Functions used to compute eigen values (and possibly eigen vectors) of one [complex|real] [un]symmetric matrix.
  * We use 4 different functions because for e;fficiency reasons, API had to be different :
  * @param pEigenVectorsImg double* output eigen vectors imaginary part
  *
  */
-extern int iEigen1ComplexSymmetricM(doublecomplex* pData, int iCols, int computeEigenVectors, double* pEigenValues);
-extern int iEigen1RealSymmetricM(double* pData, int iCols, int computeEigenVectors, double* pEigenValues);
+LINEAR_ALGEBRA_IMPEXP int iEigen1ComplexSymmetricM(doublecomplex* pData, int iCols, int computeEigenVectors, double* pEigenValues);
+LINEAR_ALGEBRA_IMPEXP int iEigen1RealSymmetricM(double* pData, int iCols, int computeEigenVectors, double* pEigenValues);
 
-extern int iEigen1ComplexM(doublecomplex* pData, int iCols, doublecomplex* pEigenValues, doublecomplex* pEigenVectors);
-extern int iEigen1RealM(double* pData, int iCols, double* pEigenValuesReal, double* pEigenValuesImg, double* pEigenVectorsReal, double* pEigenVectorsImg);
+LINEAR_ALGEBRA_IMPEXP int iEigen1ComplexM(doublecomplex* pData, int iCols, doublecomplex* pEigenValues, doublecomplex* pEigenVectors);
+LINEAR_ALGEBRA_IMPEXP int iEigen1RealM(double* pData, int iCols, double* pEigenValuesReal, double* pEigenValuesImg, double* pEigenVectorsReal, double* pEigenVectorsImg);
 
 /*
  * With 2 lhs, eigenvalues are expanded from a 1D vector to the diagonal of a matrix.
@@ -61,8 +61,8 @@ extern int iEigen1RealM(double* pData, int iCols, double* pEigenValuesReal, doub
  * @param  pRMatrix double* real part of the diagonal output matrix
  * @param  pIMatrix double* imaginary part of the diagonal output matrix
  */
-extern void expandToDiagonalOfMatrix(double* pData, int iCols);
-extern void expandZToDiagonalOfCMatrix(doublecomplex const* pZVector, int iCols, double* pRMatrix, double* pIMatrix);
+LINEAR_ALGEBRA_IMPEXP void expandToDiagonalOfMatrix(double* pData, int iCols);
+LINEAR_ALGEBRA_IMPEXP void expandZToDiagonalOfCMatrix(doublecomplex const* pZVector, int iCols, double* pRMatrix, double* pIMatrix);
 
 
 
@@ -102,9 +102,9 @@ extern void expandZToDiagonalOfCMatrix(doublecomplex const* pZVector, int iCols,
  *
  */
 
-extern int iEigen2ComplexM(doublecomplex* pData1, doublecomplex* pData2, int iCols
+LINEAR_ALGEBRA_IMPEXP int iEigen2ComplexM(doublecomplex* pData1, doublecomplex* pData2, int iCols
                     , doublecomplex* pAlpha, doublecomplex* pBeta, doublecomplex* pR, doublecomplex* pL);
-extern int iEigen2RealM(double* pData1, double* pData2, int iCols
+LINEAR_ALGEBRA_IMPEXP int iEigen2RealM(double* pData1, double* pData2, int iCols
                     , double* pAlphaReal, double* pAlphaImg, double* pBeta, double* pRReal, double* pRimg, double* pLReal, double* pLImg);
 
 #endif
index a3bc02c..09153dc 100644 (file)
@@ -41,21 +41,21 @@ LINEAR_ALGEBRA_IMPEXP int sci_zheev(char *fname, unsigned long fname_len);
 LINEAR_ALGEBRA_IMPEXP int sci_dggev(char *fname, unsigned long fname_len);
 LINEAR_ALGEBRA_IMPEXP int sci_zggev(char *fname, unsigned long fname_len);
 /*--------------------------------------------------------------------------*/
-LINEAR_ALGEBRA_IMPEXP int C2F(intschur)(char *fname, unsigned long fname_len);
+//LINEAR_ALGEBRA_IMPEXP int C2F(intschur)(char *fname, unsigned long fname_len); => C++ sci_schur
 
 //YaSp
-LINEAR_ALGEBRA_IMPEXP int sci_chol(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_bdiagr(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_svd(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_rcond(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_qr(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_lu(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_lsq(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_inv(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_hess(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_eig(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_det(char *fname, int* _piKey);
-LINEAR_ALGEBRA_IMPEXP int sci_balanc(char *fname, int* _piKey);
+//LINEAR_ALGEBRA_IMPEXP int sci_chol(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_bdiagr(char *fname, int* _piKey); => C++ => sci_bdiag
+//LINEAR_ALGEBRA_IMPEXP int sci_svd(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_rcond(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_qr(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_lu(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_lsq(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_inv(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_hess(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_eig(char *fname, int* _piKey); => C++ sci_spec
+//LINEAR_ALGEBRA_IMPEXP int sci_det(char *fname, int* _piKey); => C++
+//LINEAR_ALGEBRA_IMPEXP int sci_balanc(char *fname, int* _piKey); => C++
 
 /*--------------------------------------------------------------------------*/
 #endif /*  __GW_LINEAR_ALGEBRA__ */
index f0e56f3..e2751e3 100644 (file)
@@ -11,8 +11,9 @@
  */
 #ifndef HESS_H
 #define HESS_H
+#include "dynlib_linear_algebra.h"
 
-extern int iHessM(double * pData, int iCols, int complexArg, double* pH);
-extern int iHess(double* pData, int iCols, int complexArg, double* pH, double* pTau, double* pWork, int workSize);
+LINEAR_ALGEBRA_IMPEXP int iHessM(double * pData, int iCols, int complexArg, double* pH);
+LINEAR_ALGEBRA_IMPEXP int iHess(double* pData, int iCols, int complexArg, double* pH, double* pTau, double* pWork, int workSize);
 
 #endif
index bf66258..d299516 100644 (file)
@@ -13,8 +13,9 @@
 #ifndef _INVERT_MATRIX_H_
 #define _INVERT_MATRIX_H_
 
+#include "dynlib_linear_algebra.h"
 // TODO : add comments
-int iInvertMatrixM(int iRows, int iCols, double* pData, int complexArg
+LINEAR_ALGEBRA_IMPEXP int iInvertMatrixM(int iRows, int iCols, double* pData, int complexArg
                   , double* pdblRcond);
 
 // TODO : add comments
diff --git a/scilab/modules/linear_algebra/includes/linear_algebra_gw.hxx b/scilab/modules/linear_algebra/includes/linear_algebra_gw.hxx
new file mode 100644 (file)
index 0000000..1df9a2e
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ *  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 __LINEAR_ALGEBRA_GW_HXX__
+#define __LINEAR_ALGEBRA_GW_HXX__
+
+#include "cpp_gateway_prototype.hxx"
+
+extern "C"
+{
+#include "dynlib_linear_algebra_gw.h"
+}
+
+class LinearAlgebraModule
+{
+private :
+   LinearAlgebraModule(){};
+   ~LinearAlgebraModule(){};
+public :
+   LINEAR_ALGEBRA_GW_IMPEXP static int Load();
+};
+
+CPP_GATEWAY_PROTOTYPE(sci_chol);
+CPP_GATEWAY_PROTOTYPE(sci_bdiag);
+CPP_GATEWAY_PROTOTYPE(sci_inv);
+CPP_GATEWAY_PROTOTYPE(sci_svd);
+CPP_GATEWAY_PROTOTYPE(sci_rcond);
+CPP_GATEWAY_PROTOTYPE(sci_qr);
+CPP_GATEWAY_PROTOTYPE(sci_lu);
+CPP_GATEWAY_PROTOTYPE(sci_lsq);
+CPP_GATEWAY_PROTOTYPE(sci_hess);
+CPP_GATEWAY_PROTOTYPE(sci_spec);
+CPP_GATEWAY_PROTOTYPE(sci_det);
+CPP_GATEWAY_PROTOTYPE(sci_balanc);
+CPP_GATEWAY_PROTOTYPE(sci_schur);
+
+#endif /* !__LINEAR_ALGEBRA_GW_HXX__ */
index d7aa5aa..05686bf 100644 (file)
@@ -12,6 +12,7 @@
 #ifndef LSQ_H
 #define LSQ_H
 
+#include "dynlib_linear_algebra.h"
 /*
  * Linear least square problems. cf. http://www.scilab.org/product/man/lsq.html
  * Calls Lapack [d|z]gelsy routines after performing memory allocations
@@ -35,7 +36,7 @@
  *
  */
 
-extern int iLsqM(double* pMatrix, int iRows, int iCols, double* pRhs, int iNRhs, int complexArgs, double* pResult, double* pTreshold, int* piRank);
+LINEAR_ALGEBRA_IMPEXP int iLsqM(double* pMatrix, int iRows, int iCols, double* pRhs, int iNRhs, int complexArgs, double* pResult, double* pTreshold, int* piRank);
 
 
 #endif
index 726796b..19e5e31 100644 (file)
@@ -11,7 +11,7 @@
  */
 #ifndef LU_H
 #define LU_H
-
+#include "dynlib_linear_algebra.h"
 /**
  * iLuM performs memory allocations and computes (calling iLu) LU decomposition 
  * in :
@@ -26,8 +26,8 @@
  * (either in 'd' or 'z' format) where E result will be stored
  * @return if the operation successed (true) or not (false)
  */
-extern int iLuM(double* pData, int iRows, int iCols, int complexArg, double* pdblLData, double* pdblUData, double* pbdlEData );
-extern int iLu(double* pData, int iRows, int iCols, int complexArg, double* pdblLData, double* pdblUData, double* pbdlEData
+LINEAR_ALGEBRA_IMPEXP int iLuM(double* pData, int iRows, int iCols, int complexArg, double* pdblLData, double* pdblUData, double* pbdlEData );
+LINEAR_ALGEBRA_IMPEXP int iLu(double* pData, int iRows, int iCols, int complexArg, double* pdblLData, double* pdblUData, double* pbdlEData
               , int* piPivot, int* piWork, double* pdblWork);
 
 #endif
index 893931c..c622f13 100644 (file)
@@ -12,7 +12,7 @@
 
 #ifndef QR_H
 #define QR_H
-
+#include "dynlib_linear_algebra.h"
 /*
   Performs memory allocations and computes QR decomposition (calling iQr)
  * in :
@@ -30,6 +30,6 @@
  * @param pdblRank double*  NULL if rank does not need to be computed, otherwise pointer to memory where rank will be stored
  * @return if the operation successed (true) or not (false)
  */  
-int iQrM(double* pData, int iRows, int iCols, int /*bool*/ complexArg, int iRowsToCompute, double dblTol
+LINEAR_ALGEBRA_IMPEXP int iQrM(double* pData, int iRows, int iCols, int /*bool*/ complexArg, int iRowsToCompute, double dblTol
         , double* pdblQ, double* pdblR, double* pdblE, double* pdblRank);
 #endif
index c8c01ec..7a2a159 100644 (file)
@@ -11,6 +11,9 @@
  *
  */
 
+#ifndef __RCOND_H__
+#define __RCOND_H__
+#include "dynlib_linear_algebra.h"
 /*
  * inverse condition number of a real or complex matrix. see http://www.scilab.org/product/man/rcond.html
  *
@@ -28,4 +31,5 @@
  *
  */
 
-extern int iRcondM(double* pData, int iCols, int complexArg, double* pRcond);
+LINEAR_ALGEBRA_IMPEXP int iRcondM(double* pData, int iCols, int complexArg, double* pRcond);
+#endif /* !__RCOND_H__ */
\ No newline at end of file
index 1835ddd..61aab66 100644 (file)
@@ -9,8 +9,9 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
-
-
+#ifndef __SVD_H__
+#define __SVD_H__
+#include "dynlib_linear_algebra.h"
 /*
  * perform singular value decomposition (cf. http://www.scilab.org/product/man/svd.html ), MALLOCating temporary buffers as needed.
  *
@@ -34,4 +35,5 @@
  * @return 0 success, -1 MALLOC failure >0 Lapack convergence problems
  *
  */
-int iSvdM(double* pData, int iRows, int iCols, int complexArg, int economy, double tol, double* pSV, double* pU, double* pS, double* pV, double* pRk);
+LINEAR_ALGEBRA_IMPEXP int iSvdM(double* pData, int iRows, int iCols, int complexArg, int economy, double tol, double* pSV, double* pU, double* pS, double* pV, double* pRk);
+#endif /* !__SVD_H__ */
\ No newline at end of file
index 046b930..22cf6ba 100644 (file)
@@ -19,6 +19,7 @@
 #define LINEAR_ALGEBRA "linear_algebra"
 ;
 Source: bin\{#LINEAR_ALGEBRA}.dll; DestDir: {app}\bin; Components: {#COMPN_LINALG}
+Source: bin\{#LINEAR_ALGEBRA}_gw.dll; DestDir: {app}\bin; Components: {#COMPN_LINALG}
 Source: bin\{#LINEAR_ALGEBRA}_f.dll; DestDir: {app}\bin; Components: {#COMPN_LINALG}
 ;
 Source: modules\{#LINEAR_ALGEBRA}\license.txt; DestDir: {app}\modules\{#LINEAR_ALGEBRA}; Components: {#COMPN_LINALG}
index 475d87d..2820ab6 100644 (file)
@@ -24,7 +24,7 @@ static int C2F(intvoid)(char *fname, unsigned long fname_len)
 #define LINEAR_ALGEBRA_TAB_SIZE 6
 static gw_generic_table Tab[LINEAR_ALGEBRA_TAB_SIZE]={
   {NULL, ""}, //hess
-  {C2F(intschur),"schur"},
+  {NULL, ""}, //schur
   {NULL, ""}, //spec
   {NULL, ""}, //bdiag
   {C2F(intvoid),"xxxx"},
index 8df33f4..e1cbb15 100644 (file)
@@ -29,7 +29,7 @@ static gw_generic_table Tab[LINEAR_ALGEBRA2_TAB_SIZE]={
        {NULL, ""}, //lu
        {C2F(intslash),"slash"},
        {C2F(intbackslash),"backslash"},
-       {C2F(intschur),"schur"},
+       {NULL, ""}, //schur
        {NULL, ""}, //hess
        {NULL, ""}, //det
        {NULL, ""} //balanc
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.cpp
new file mode 100644 (file)
index 0000000..cdb35c8
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ *  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 "linear_algebra_gw.hxx"
+extern "C"
+{
+    #include "gw_linear_algebra.h"
+}
+
+#define MODULE_NAME L"linear_algebra"
+
+int LinearAlgebraModule::Load()
+{
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"chol", &sci_chol, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"bdiag", &sci_bdiag, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"svd", &sci_svd, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rcond", &sci_rcond, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"qr", &sci_qr, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"lu", &sci_lu, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"lsq", &sci_lsq, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inv", &sci_inv, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"hess", &sci_hess, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"spec", &sci_spec, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"det", &sci_det, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"balanc", &sci_balanc, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"schur", &sci_schur, MODULE_NAME));
+    return true;
+}
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj b/scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj
new file mode 100644 (file)
index 0000000..5bbdf9c
--- /dev/null
@@ -0,0 +1,243 @@
+<?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>{EE43BE6D-817D-4B09-AC40-7E6AC5BDB80D}</ProjectGuid>
+    <RootNamespace>linear_algebra_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;../../src/cpp;../../../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;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LINEAR_ALGEBRA_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/linear_algebra_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../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;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LINEAR_ALGEBRA_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/linear_algebra_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <AdditionalIncludeDirectories>../../includes;../../src/cpp;../../../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;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LINEAR_ALGEBRA_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/linear_algebra_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;../../src/cpp;../../../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;../../../api_scilab/includes;../../../threads/includes;../../../system_env/includes;../../../string/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LINEAR_ALGEBRA_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/linear_algebra_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\cpp\schurSelect.cpp" />
+    <ClCompile Include="..\..\src\cpp\scischur.cpp" />
+    <ClCompile Include="linear_algebra_gw.cpp" />
+    <ClCompile Include="sci_balanc.cpp" />
+    <ClCompile Include="sci_bdiag.cpp" />
+    <ClCompile Include="sci_chol.cpp" />
+    <ClCompile Include="sci_det.cpp" />
+    <ClCompile Include="sci_hess.cpp" />
+    <ClCompile Include="sci_inv.cpp" />
+    <ClCompile Include="sci_lsq.cpp" />
+    <ClCompile Include="sci_lu.cpp" />
+    <ClCompile Include="sci_qr.cpp" />
+    <ClCompile Include="sci_rcond.cpp" />
+    <ClCompile Include="sci_schur.cpp" />
+    <ClCompile Include="sci_spec.cpp" />
+    <ClCompile Include="sci_svd.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\includes\linear_algebra_gw.hxx" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\ast\ast-tools\ast-tools.vcxproj">
+      <Project>{1f4a0344-99ed-461b-bd53-1593788fb34d}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\ast\ast.vcxproj">
+      <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\elementary_functions\src\cpp\elem_func\elem_func.vcxproj">
+      <Project>{e1284d3e-4b3f-446b-b541-f661a8a166a7}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\elementary_functions\src\c\elementary_functions.vcxproj">
+      <Project>{5b110267-7c18-437c-b87d-dba2b50729e9}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
+      <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\operations\operations.vcxproj">
+      <Project>{1bb396f7-ce61-4cfc-9c22-266b2cfb2e74}</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="..\..\..\system_env\system_env.vcxproj">
+      <Project>{7ca60aef-9afa-4d06-af28-613c0aa27640}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\types\types.vcxproj">
+      <Project>{64e090da-dcb5-4f4d-93d7-e88ddec9c2ef}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\types\typesmacro\typesmacro.vcxproj">
+      <Project>{9252a034-7f22-4cb1-a634-4577da69f2d0}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\src\c\linear_algebra.vcxproj">
+      <Project>{bc462a57-c5b3-4f93-8067-80363827dcda}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Library Include="..\..\..\..\bin\blasplus.lib" />
+    <Library Include="..\..\..\..\bin\elementary_functions_f.lib" />
+    <Library Include="..\..\..\..\bin\lapack.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/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj.filters b/scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.vcxproj.filters
new file mode 100644 (file)
index 0000000..a920da6
--- /dev/null
@@ -0,0 +1,78 @@
+<?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>
+    <ClCompile Include="linear_algebra_gw.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_balanc.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_bdiag.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_chol.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_det.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_hess.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_inv.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_lsq.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_lu.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_qr.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_rcond.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_schur.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_spec.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_svd.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\cpp\schurSelect.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\cpp\scischur.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\includes\linear_algebra_gw.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Library Include="..\..\..\..\bin\libintl.lib" />
+    <Library Include="..\..\..\..\bin\blasplus.lib" />
+    <Library Include="..\..\..\..\bin\lapack.lib" />
+    <Library Include="..\..\..\..\bin\elementary_functions_f.lib" />
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_balanc.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_balanc.cpp
new file mode 100644 (file)
index 0000000..27347fa
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "balanc.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_balanc(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl[2]      = {NULL, NULL};
+    types::Double* pDblRes[2]   = {NULL, NULL};
+    double* pData[2]            = {NULL, NULL};
+    bool bComplex               = false;
+
+    if(in.size() != 1 && in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"balanc", 1, 2);
+        return types::Function::Error;
+    }
+
+    if(_iRetCount != 2*in.size())
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"balanc", 2*in.size());
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_balanc";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl[0] = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>();
+    if(pDbl[0]->isComplex())
+    {
+        bComplex = true;
+    }
+
+    if(in.size() == 2)
+    {
+        if((in[1]->isDouble() == false))
+        {
+            std::wstring wstFuncName = L"%"  + in[1]->getShortTypeStr() + L"_balanc";
+            return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+        }
+
+        pDbl[1] = in[1]->getAs<types::Double>()->clone()->getAs<types::Double>();
+        if(pDbl[1]->isComplex())
+        {
+            bComplex = true;
+        }
+
+        if(pDbl[0]->getRows() != pDbl[1]->getRows())
+        {
+            ScierrorW(999, _W("%ls: Arguments %d and %d must have equal dimensions.\n"), L"balanc", 1, 2);
+            return types::Function::Error;
+        }
+    }
+
+    if(pDbl[0]->getCols() == 0)
+    {
+        out.push_back(types::Double::Empty());
+        out.push_back(types::Double::Empty());
+        if(_iRetCount == 4)
+        {
+            out.push_back(types::Double::Empty());
+            out.push_back(types::Double::Empty());
+        }
+        return types::Function::OK;
+    }
+
+    if(pDbl[0]->getRows() != pDbl[0]->getCols())
+    {
+        ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"balanc", 1);
+        return types::Function::Error;
+    }
+
+    for(int i=0; i<in.size(); i++)
+    {
+        if(bComplex)
+        {
+            pData[i] = (double*)oGetDoubleComplexFromPointer(pDbl[i]->getReal(), pDbl[i]->getImg(), pDbl[i]->getSize());
+            if(!pData[i])
+            {
+                ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"balanc");
+                return types::Function::Error;
+            }
+        }
+        else
+        {
+            pData[i] = pDbl[i]->getReal();
+        }
+
+        pDblRes[i] = new types::Double(pDbl[i]->getRows(), pDbl[i]->getCols());
+    }
+
+    int iRet = iBalancM(pData[0], pData[1], pDbl[0]->getCols(), bComplex, pDblRes[0]->get(), ( pDblRes[1] ? pDblRes[1]->get() : NULL));
+
+    if(iRet != 0)
+    {
+           ScierrorW(999, _W("%ls: LAPACK error n°%d.\n"), L"balanc",iRet);
+        return types::Function::Error;
+    }
+
+    if(bComplex)
+    {
+        for(int i=0; i<in.size(); i++)
+        {
+            vGetPointerFromDoubleComplex((doublecomplex*)pData[i], pDbl[i]->getSize(), pDbl[i]->getReal(), pDbl[i]->getImg());
+            vFreeDoubleComplexFromPointer((doublecomplex*)pData[i]);
+        }
+    }
+
+    if(_iRetCount == 2)
+    {
+        out.push_back(pDbl[0]);
+        out.push_back(pDblRes[0]);
+    }
+    else //_iRetCount == 4
+    {
+        out.push_back(pDbl[0]);
+        out.push_back(pDbl[1]);
+        out.push_back(pDblRes[0]);
+        out.push_back(pDblRes[1]);
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_bdiag.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_bdiag.cpp
new file mode 100644 (file)
index 0000000..0fbf25e
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "core_math.h" /* for Abs  macro */
+}
+/*--------------------------------------------------------------------------*/
+extern "C"
+{
+extern int C2F(vfinite)(int const*n, double const*v);
+
+extern void C2F(bdiag)(int const * lda, int const* n, double* a, double const * epsshr, double const* rMax, double* er, double* ei, int *bs
+                      , double* x, double* xi, double* scale, int const* job, int * fail);
+extern void C2F(wbdiag)(int const* lda, int const* n, double* ar, double* ai, double const*rMax, double* er, double* ei, int* bs
+                       , double* xr , double* xi, double* yr, double* yi, double* scale, int const* job, int* fail);
+}
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_bdiag(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDblMatrix   = NULL;
+    types::Double* pDblScalar   = NULL;
+    double rMax                 = 0;
+
+    if((in.size() != 1) && (in.size() != 2))
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"bdiag", 1, 2);
+        return types::Function::Error;
+    }
+    if(_iRetCount > 3)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"bdiag", 1, 3);
+        return types::Function::Error;
+    }
+
+    if(in[0]->isDouble() == false)
+    {
+        ScierrorW(201, _W("%ls: Wrong type for argument %d: Real or complex matrix expected.\n"), L"bdiag", 1);
+        return types::Function::Error;     
+    }
+
+    pDblMatrix = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>(); // input data will be modified
+    if(pDblMatrix->getRows() != pDblMatrix->getCols())
+    {
+               ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"bdiag", 1);
+        return types::Function::Error;      
+    }
+
+    if(in.size() == 2)
+    {
+        if(in[1]->isDouble() == false && in[1]->getAs<types::Double>()->isScalar() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for argument %d: A scalar expected.\n"), L"bdiag", 2);
+            return types::Function::Error;     
+        }
+
+        pDblScalar = in[1]->getAs<types::Double>();
+    }
+
+    if(pDblMatrix->getCols() == 0)
+    {
+        int value = Min(_iRetCount, 3);
+        for(int i = 0; i < value; i++)
+        {
+            out.push_back(types::Double::Empty());
+        }
+        return types::Function::OK;
+    }
+
+    int const totalSize = pDblMatrix->getSize();
+
+    if( C2F(vfinite)(&totalSize, pDblMatrix->getReal()) == false &&
+        (pDblMatrix->isComplex() == false || 
+         C2F(vfinite)(&totalSize, pDblMatrix->getImg())))
+    {
+               ScierrorW(264, _W("%ls: Wrong value for argument %d: Must not contain NaN or Inf.\n"), L"bdiag", 1);
+        return types::Function::Error;   
+    }
+
+    if(pDblScalar != NULL)
+    {
+        rMax = pDblScalar->get(0);
+    }
+    else
+    {
+        for(int j = 0; j < pDblMatrix->getCols(); j++)
+        {
+            double t = 0.0;
+            for(int i = 0; i < pDblMatrix->getCols(); i++)
+            {
+                t += Abs(pDblMatrix->get(i+j*pDblMatrix->getCols()));
+            }
+            rMax = Max(t, rMax);
+        }
+    }
+
+    types::Double* lx = pDblMatrix->clone()->getAs<types::Double>();
+    int iDim        = pDblMatrix->getCols(); // square matrix
+    int fail        = 0;
+    int const job   = 0;
+
+    /* allocating the two memory buffers in one place as the original code did */
+    double* le = (double*) MALLOC( 2*iDim * sizeof(double) );
+    int*    lib= (int*) MALLOC(iDim * sizeof(int));
+    double* lw = (double*)MALLOC(iDim * sizeof(double));
+
+    if((le && lib && lw) == false)
+    {
+               ScierrorW(999, _W("%ls: Allocation failed.\n"), L"bdiag");
+        return types::Function::Error;   
+    }
+
+    if(pDblMatrix->isComplex())
+    {
+        double dummy;
+        C2F(wbdiag)(&iDim, &iDim, pDblMatrix->getReal(), pDblMatrix->getImg(), &rMax, le, le + iDim, lib, lx->getReal() , lx->getImg(),  &dummy, &dummy, lw, &job, &fail);
+    }
+    else
+    {
+        double const epsshr= 0.;
+        C2F(bdiag)(&iDim, &iDim, pDblMatrix->getReal(), &epsshr, &rMax, le, le + iDim, lib, lx->getReal(), NULL /* not used when job = 0 */, lw, &job, &fail);
+    }
+
+    if(fail)
+    {
+        FREE(le);
+        FREE(lib);
+        FREE(lw);
+               ScierrorW(24, _W("%ls: Non convergence in QR steps.\n"), L"bdiag");
+        return types::Function::Error;   
+    }
+    else
+    {
+        out.push_back(pDblMatrix);
+        if(_iRetCount > 1)
+        {
+            out.push_back(lx);
+        }
+        if(_iRetCount == 3)
+        {
+            int nbloc   = 0;
+            int k       = 0;
+
+            for(k = 0; k < iDim; k++)
+            {
+                if(lib[k] >= 0)
+                {
+                    nbloc++;
+                }
+            }
+
+            types::Double* lbs = new types::Double(nbloc, 1);
+
+            for (int i = k = 0; k < iDim; k++)
+            {
+                if(lib[k] >= 0)
+                {
+                    lbs->set(i,(double) lib[k]);
+                    i++;
+                }
+            }
+            out.push_back(lbs);
+        }
+        FREE(le);
+        FREE(lib);
+        FREE(lw);
+    }
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_chol.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_chol.cpp
new file mode 100644 (file)
index 0000000..c2680a1
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "chol.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_chol(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl     = NULL;
+    double* pdOut           = NULL;
+    int iCholProductResult  = 0;
+    types::Double* result   = NULL;
+
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"chol", 1);
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_chol";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl = in[0]->getAs<types::Double>();
+    if(pDbl->getRows() != pDbl->getCols())
+    {
+               ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"chol", 1);
+        return types::Function::Error;            
+    }
+
+    if(pDbl->getRows() == 0)
+    {
+        out.push_back(types::Double::Empty());
+        return types::Function::OK;
+    }
+    else if(pDbl->getRows() == -1) // manage eye case
+    {
+        if(pDbl->get(0) <= 0)
+        {
+               /* Matrix must be positive definite */
+                       ScierrorW(29, _W("%ls: Matrix is not positive definite.\n"), L"chol");
+            return types::Function::Error;
+        }
+
+        types::Double* result = new types::Double(sqrt(pDbl->get(0)));
+        out.push_back(result);
+        return types::Function::OK;
+    }
+
+    if(pDbl->isComplex())
+    {
+        doublecomplex* poData = oGetDoubleComplexFromPointer(pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+               iCholProductResult = iComplexCholProduct(poData, pDbl->getRows());
+
+        result = new types::Double(pDbl->getRows(), pDbl->getCols(), true);
+        
+               vGetPointerFromDoubleComplex(poData, pDbl->getSize(), result->getReal(), result->getImg());
+               vFreeDoubleComplexFromPointer(poData);
+    }
+    else
+    {
+        result = pDbl->clone()->getAs<types::Double>();
+               iCholProductResult = iRealCholProduct(result->get(), pDbl->getRows());
+    }
+
+    if(iCholProductResult > 0)
+    {
+       /* Matrix must be positive definite */
+               ScierrorW(29, _W("%ls: Matrix is not positive definite.\n"), L"chol");
+        return types::Function::Error;
+    }
+
+    out.push_back(result);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_det.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_det.cpp
new file mode 100644 (file)
index 0000000..7980db6
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "det.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_det(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl             = NULL;
+    types::Double* pDblMantissa     = NULL;
+    types::Double* pDblExponent     = NULL;
+    double* pData                   = NULL;
+
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"det", 1);
+        return types::Function::Error;
+    }
+
+    if(_iRetCount > 2)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"det", 1, 2);
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_det";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>();
+
+    if(pDbl->isComplex())
+    {
+        pData = (double *)oGetDoubleComplexFromPointer(pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+        if(!pData)
+        {
+            ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"det");
+            return types::Function::Error;
+        }
+    }
+    else
+    {
+        pData = pDbl->getReal();
+    }
+
+    if(pDbl->getRows() != pDbl->getCols())
+    {
+        ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"det", 1);
+        return types::Function::Error;
+    }
+
+    if((pDbl->getRows() == -1)) // manage eye case
+    {
+        ScierrorW(271,_W("%ls: Size varying argument a*eye(), (arg %d) not allowed here.\n"), L"det", 1);
+        return types::Function::Error;
+    }
+
+    if(pDbl->getCols() == -1)
+    {
+        types::Double* pDblEyeMatrix = new types::Double(-1, -1);
+        out.push_back(pDblEyeMatrix);
+        return types::Function::Error;
+    }
+
+    if(pDbl->isComplex())
+    {
+        pData = (double *)oGetDoubleComplexFromPointer(pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+        if(!pData)
+        {
+            ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"det");
+            return types::Function::Error;
+        }
+    }
+    else
+    {
+        pData = pDbl->getReal();
+    }
+
+    pDblMantissa = new types::Double(1, 1, pDbl->isComplex());
+
+    if(_iRetCount == 2)
+    {
+        pDblExponent = new types::Double(1,1);
+    }
+
+    int iExponent = 0;
+    int iRet= iDetM(pData, pDbl->getCols(), pDblMantissa->getReal(), pDbl->isComplex() ? pDblMantissa->getImg() : NULL, pDblExponent ? &iExponent : NULL);
+    if(iRet != 0)
+    {
+           ScierrorW(999, _W("%ls: LAPACK error n°%d.\n"), L"det",iRet);
+        return types::Function::Error;
+    }
+
+    if(pDblExponent)
+    {
+        pDblExponent->set(0, iExponent);
+    }
+
+    if(pDbl->isComplex())
+    {
+        vFreeDoubleComplexFromPointer((doublecomplex*)pData);
+    }
+
+    if(_iRetCount == 2)
+    {
+        out.push_back(pDblExponent);
+    }
+
+    out.push_back(pDblMantissa);
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_hess.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_hess.cpp
new file mode 100644 (file)
index 0000000..8fe98f6
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "hess.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_hess(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl     = NULL;
+    types::Double* pDblH    = NULL;
+    double* pdH             = NULL;
+    double* pData           = NULL;
+
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"hess", 1);
+        return types::Function::Error;
+    }
+
+    if(_iRetCount > 2)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"hess", 1, 2);
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_hess";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>();
+
+    if(pDbl->getRows() != pDbl->getCols())
+    {
+        ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"hess", 1);
+        return types::Function::Error;
+    }
+
+    if((pDbl->getCols() == 0) || (pDbl->getRows() == 0))
+    {
+        out.push_back(types::Double::Empty());
+        if(_iRetCount == 2)
+        {
+            out.push_back(types::Double::Empty());
+        }
+        return types::Function::OK;
+    }
+
+    if(pDbl->getCols() == -1)
+    {
+        types::Double* pDblEyeMatrix = new types::Double(-1, -1);
+        out.push_back(pDblEyeMatrix);
+        return types::Function::Error;
+    }
+
+    if(pDbl->isComplex())
+    {
+        pData = (double *)oGetDoubleComplexFromPointer(pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+        if(!pData)
+        {
+            ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"hess");
+            return types::Function::Error;
+        }
+    }
+    else
+    {
+        pData = pDbl->getReal();
+    }
+
+    if(_iRetCount == 2)
+    {
+        pDblH = new types::Double(pDbl->getRows(), pDbl->getCols(), pDbl->isComplex());
+        if(pDbl->isComplex())
+        {
+            pdH = (double*)MALLOC(pDblH->getSize() * sizeof(doublecomplex));
+            if(!pdH)
+            {
+                ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"hess");
+                return types::Function::Error;
+            }
+        }
+        else
+        {
+            pdH = pDblH->getReal();
+        }
+    }
+
+    int iRet = iHessM(pData, pDbl->getCols(), pDbl->isComplex(), pdH);
+    if(iRet != 0)
+    {
+           ScierrorW(999, _W("%ls: LAPACK error n°%d.\n"), L"hess",iRet);
+        return types::Function::Error;
+    }
+
+    if(pDbl->isComplex())
+    {
+        vGetPointerFromDoubleComplex((doublecomplex*)(pData), pDbl->getSize(), pDbl->getReal(), pDbl->getImg());
+               vFreeDoubleComplexFromPointer((doublecomplex*)pData);
+
+        if(_iRetCount == 2)
+        {
+            vGetPointerFromDoubleComplex((doublecomplex*)(pdH), pDblH->getSize(), pDblH->getReal(), pDblH->getImg());
+               vFreeDoubleComplexFromPointer((doublecomplex*)pdH);
+        }
+    }
+
+    if(_iRetCount == 1)
+    {
+        out.push_back(pDbl);
+    }
+    else
+    {
+        out.push_back(pDblH);
+        out.push_back(pDbl);
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_inv.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_inv.cpp
new file mode 100644 (file)
index 0000000..03a5b80
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "invert_matrix.h"
+#include "sci_warning.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_inv(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl = NULL;
+    double* pData       = NULL;
+    int ret             = 0;
+
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"inv", 1);
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_inv";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>(); // input data will be modified
+
+    if(pDbl->getRows() != pDbl->getCols())
+    {
+        ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"inv", 1);
+        return types::Function::Error;      
+    }
+
+    if(pDbl->getRows() == 0)
+    {
+        out.push_back(types::Double::Empty());
+        return types::Function::OK;
+    }
+
+    if(pDbl->isComplex())
+    {
+        /* c -> z */
+        pData = (double*)oGetDoubleComplexFromPointer( pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+    }
+    else
+    {
+        pData = pDbl->getReal();
+    }
+
+    if(pDbl->getCols() == -1)
+    {
+        pData[0] = 1./pData[0];
+    }
+    else
+    {
+        double dblRcond;
+        ret = iInvertMatrixM(pDbl->getRows(), pDbl->getCols(), pData, pDbl->isComplex(), &dblRcond);
+        if(pDbl->isComplex())
+        {
+            /* z -> c */
+            vGetPointerFromDoubleComplex((doublecomplex*)pData, pDbl->getSize(), pDbl->getReal(), pDbl->getImg());
+            vFreeDoubleComplexFromPointer((doublecomplex*)pData);
+        }
+
+        if(ret == -1)
+        {
+            if(getWarningMode())
+            {
+                sciprint(_("Warning :\n"));
+                sciprint(_("matrix is close to singular or badly scaled. rcond = %1.4E\n"), dblRcond);
+                sciprint(_("computing least squares solution. (see lsq).\n"));
+            }
+           }
+    }
+
+    if(ret == 19)
+    {
+        ScierrorW(19, _W("%ls: Problem is singular.\n"), L"inv");
+        return types::Function::Error;
+    }
+
+    out.push_back(pDbl);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_lsq.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_lsq.cpp
new file mode 100644 (file)
index 0000000..322577c
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "lsq.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_lsq(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl[2]      = {NULL, NULL};
+    types::Double* pDblResult   = NULL;
+    double* pData[2]            = {NULL, NULL};
+    double* pResult             = NULL;
+    double* pdTol               = NULL;
+    bool bComplexArgs           = false;
+    int iRank                   = 0;
+
+    if(in.size() < 2 || in.size() > 3)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"lsq", 2, 3);
+        return types::Function::Error;
+    }
+
+    if(_iRetCount > 2)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"lsq", 1, 2);
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_lsq";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    if(in.size() == 2)
+    {
+        if((in[1]->isDouble() == false))
+        {
+            std::wstring wstFuncName = L"%"  + in[1]->getShortTypeStr() + L"_lsq";
+            return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+        }
+        pDbl[1] = in[1]->getAs<types::Double>()->clone()->getAs<types::Double>();
+    }
+
+    if(in.size() == 3)
+    {
+        if((in[2]->isDouble() == false) || (in[2]->getAs<types::Double>()->isComplex()) || (in[2]->getAs<types::Double>()->isScalar() == false))
+        {
+            ScierrorW(256, _W("%ls: Wrong type for input argument #%d: A Real expected.\n"), L"lsq", 3);
+            return types::Function::Error;     
+        }
+        *pdTol = in[2]->getAs<types::Double>()->get(0);
+    }
+
+    pDbl[0] = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>();
+
+    if(pDbl[0]->getRows() != pDbl[1]->getRows())
+    {
+        ScierrorW(265, _W("%ls: %ls and %ls must have equal number of rows.\n"), L"lsq", L"A", L"B");
+        return types::Function::Error;
+    }
+
+    if((pDbl[0]->getCols() == 0) || (pDbl[1]->getCols() == 0))
+    {
+        out.push_back(types::Double::Empty());
+        if(_iRetCount == 2)
+        {
+            out.push_back(types::Double::Empty());
+        }
+        return types::Function::OK;
+    }
+
+    if(pDbl[0]->isComplex() || pDbl[1]->isComplex())
+    {
+        bComplexArgs = true;
+    }
+    for(int i=0; i<2; i++)
+    {
+        if(pDbl[i]->getCols() == -1)
+        {
+            ScierrorW(271, _W("%ls: Size varying argument a*eye(), (arg %d) not allowed here.\n"), L"lsq", i+1);
+            return types::Function::Error;
+        }
+
+        if(bComplexArgs)
+        {
+            pData[i] = (double*)oGetDoubleComplexFromPointer(pDbl[i]->getReal(), pDbl[i]->getImg(), pDbl[i]->getSize());
+            if(!pData[i])
+            {
+                ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"lsq");
+                return types::Function::Error;
+            }
+        }
+        else
+        {
+            pData[i] = pDbl[i]->getReal();
+        }
+    }
+
+    pDblResult = new types::Double(pDbl[0]->getCols(), pDbl[1]->getCols(), bComplexArgs);
+
+    if(bComplexArgs)
+    {
+        pResult = (double*)MALLOC(pDbl[0]->getCols() * pDbl[1]->getCols() * sizeof(doublecomplex));
+    }
+    else
+    {
+        pResult = pDblResult->get();
+    }
+
+    int iRet = iLsqM(pData[0], pDbl[0]->getRows(), pDbl[0]->getCols(), pData[1], pDbl[1]->getCols(), bComplexArgs, pResult, pdTol, ((_iRetCount == 2) ? &iRank : NULL));
+
+    if(iRet != 0)
+    {
+        if(iRet == -1)
+        {
+                   ScierrorW(999, _W("%ls: Allocation failed.\n"), L"lsq");
+        }
+        else
+        {
+                   ScierrorW(999, _W("%ls: LAPACK error n°%d.\n"), L"lsq",iRet);
+        }
+        return types::Function::Error;
+    }
+
+    if(bComplexArgs)
+    {
+        vGetPointerFromDoubleComplex((doublecomplex*)(pResult), pDblResult->getSize(), pDblResult->getReal(), pDblResult->getImg());
+        vFreeDoubleComplexFromPointer((doublecomplex*)pResult);
+               vFreeDoubleComplexFromPointer((doublecomplex*)pData[0]);
+        vFreeDoubleComplexFromPointer((doublecomplex*)pData[1]);
+    }
+
+    out.push_back(pDblResult);
+    if(_iRetCount == 2)
+    {
+        types::Double* pDblRank = new types::Double(1,1);
+        pDblRank->set(0, iRank);
+        out.push_back(pDblRank);
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_lu.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_lu.cpp
new file mode 100644 (file)
index 0000000..e46921b
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "lu.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_lu(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl     = NULL;
+    types::Double* pDblL    = NULL;
+    types::Double* pDblU    = NULL;
+    types::Double* pDblE    = NULL;
+    double* pdL             = NULL;
+    double* pdU             = NULL;
+    double* pData           = NULL;
+    int iMinRowsCols        = 0;
+
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"lu", 1);
+        return types::Function::Error;
+    }
+
+    if(_iRetCount < 2 || _iRetCount > 3)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"lu", 2, 3);
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_lu";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>();
+
+    if(pDbl->isComplex())
+    {
+        pData = (double*)oGetDoubleComplexFromPointer(pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+        if(!pData)
+        {
+            ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"lu");
+            return types::Function::Error;
+        }
+    }
+    else
+    {
+        pData = pDbl->getReal();
+    }
+
+    if((pDbl->getCols() == 0) || (pDbl->getRows() == 0))
+    {
+        out.push_back(types::Double::Empty());
+        out.push_back(types::Double::Empty());
+        if(_iRetCount == 3)
+        {
+            out.push_back(types::Double::Empty());
+        }
+        return types::Function::OK;
+    }
+
+    if((pDbl->getRows() == -1) || (pDbl->getCols() == -1))  // Rhs(1)=k*eye() => Lhs(1)=eye()
+    {                                                       // Lhs(2)=k*eye(), Lhs(3)=eye()
+        pDblL = new types::Double(-1, -1, pDbl->isComplex());
+        pDblL->set(0,1);
+        out.push_back(pDblL);
+        out.push_back(pDbl);
+        if(_iRetCount == 3)
+        {
+            pDblE = new types::Double(-1, -1, pDbl->isComplex());
+            pDblE->set(0,1);
+            out.push_back(pDblE);            
+        }
+        return types::Function::OK;
+    }
+
+    iMinRowsCols = Min(pDbl->getRows(), pDbl->getCols());
+    pDblL = new types::Double(pDbl->getRows(), iMinRowsCols, pDbl->isComplex());
+    pDblU = new types::Double(iMinRowsCols, pDbl->getCols(), pDbl->isComplex());
+
+    if(pDbl->isComplex())
+    {
+           pdL = (double*) MALLOC(pDblL->getSize() * sizeof(doublecomplex));
+           pdU = (double*) MALLOC(pDblU->getSize() * sizeof(doublecomplex));
+    }
+    else
+    {
+        pdL = pDblL->get();
+        pdU = pDblU->get();
+    }
+
+    if(_iRetCount == 3)
+    {
+        pDblE = new types::Double(pDbl->getRows(), pDbl->getRows());
+    }
+
+    int iRet = iLuM(pData, pDbl->getRows(), pDbl->getCols(), pDbl->isComplex(), pdL, pdU, (pDblE ? pDblE->get() : NULL));
+
+    if(iRet != 0)
+    {
+           ScierrorW(999, _W("%ls: LAPACK error n°%d.\n"), L"lu",iRet);
+        return types::Function::Error;
+    }
+
+    if(pDbl->isComplex())
+    {
+        vGetPointerFromDoubleComplex((doublecomplex*)pdL, pDblL->getSize(), pDblL->getReal(), pDblL->getImg());
+        FREE((doublecomplex*)pdL);
+        vGetPointerFromDoubleComplex((doublecomplex*)pdU, pDblU->getSize(), pDblU->getReal(), pDblU->getImg());
+        FREE((doublecomplex*)pdU);
+    }
+
+    if(pDbl->isComplex())
+    {
+        vFreeDoubleComplexFromPointer((doublecomplex*)pData);
+    }
+
+    out.push_back(pDblL);
+    out.push_back(pDblU);    
+    if(_iRetCount == 3)
+    {
+        out.push_back(pDblE);
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_qr.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_qr.cpp
new file mode 100644 (file)
index 0000000..73ef677
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "qr.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_qr(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl     = NULL;
+    types::Double* pDblQ    = NULL;
+    types::Double* pDblR    = NULL;
+    types::Double* pDblE    = NULL;
+    types::Double* pDblRk   = NULL;
+    double* pdQ             = NULL;
+    double* pdR             = NULL;
+    double* pData           = NULL;
+    double dTol             = -1.;
+    int iRowsToCompute      = 0;
+
+    if(in.size() != 1 && in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"qr", 1, 2);
+        return types::Function::Error;
+    }
+
+    if(_iRetCount > 4)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"qr", 1, 4);
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_qr";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>();
+
+    if(pDbl->isComplex())
+    {
+        pData = (double*)oGetDoubleComplexFromPointer(pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+        if(!pData)
+        {
+            ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"qr");
+            return types::Function::Error;
+        }
+    }
+    else
+    {
+        pData = pDbl->getReal();
+    }
+
+    if((pDbl->getCols() == 0) || (pDbl->getRows() == 0))
+    {
+        if(_iRetCount == 4)
+        {
+            types::Double* zero = new types::Double(1,1);
+            zero->set(0,0);
+            out.push_back(types::Double::Empty());
+            out.push_back(types::Double::Empty());
+            out.push_back(zero);
+            out.push_back(types::Double::Empty());
+        }
+        else
+        {
+            out.push_back(types::Double::Empty());
+            for(int i=1; i < _iRetCount; i++)
+            {
+                out.push_back(types::Double::Empty());
+            }
+        }
+        return types::Function::OK;
+    }
+
+    if((pDbl->getRows() == -1) || (pDbl->getCols() == -1)) // manage eye case
+    {
+        ScierrorW(271,_W("%ls: Size varying argument a*eye(), (arg %d) not allowed here.\n"), L"qr", 1);
+        return types::Function::Error;
+    }
+
+    iRowsToCompute = pDbl->getRows();
+
+    if(in.size() == 2)
+    {
+       if(in[1]->isString() == true)
+        {/* /!\ original code did not check that string is "e" so any [matrix of] string is accepted as "e" ! */
+            /*
+            types::String* pStr = in[1]->getAs<types::String>();
+            if((wcslen(pStr->get(0)) == 1) && (pStr->get(0)[0] == L'e'))
+            */
+            iRowsToCompute = Min(pDbl->getRows(), pDbl->getCols());
+        }
+        else if(in[1]->isDouble() == true)
+        {/* /!\ original code do not check anything (real && 1x1 matrix)*/
+            dTol = in[1]->getAs<types::Double>()->get(0);
+        }
+        else
+        {
+            ScierrorW(999,_W("%ls: Wrong type for input argument #%d: A real or a string expected.\n"), L"qr", 2);
+            return types::Function::Error;
+        }
+    }
+
+    pDblQ = new types::Double(pDbl->getRows(), iRowsToCompute, pDbl->isComplex());
+    pDblR = new types::Double(iRowsToCompute, pDbl->getCols(), pDbl->isComplex());
+
+    if(pDbl->isComplex())
+    {
+               pdQ = (double*) MALLOC(pDbl->getRows() * iRowsToCompute * sizeof(doublecomplex));
+               pdR = (double*) MALLOC(iRowsToCompute * pDbl->getCols() * sizeof(doublecomplex));
+    }
+    else
+    {
+        pdQ = pDblQ->get();
+        pdR = pDblR->get();
+    }
+
+    if(_iRetCount >= 3)/* next alloc for E needed only for _iRetCount>=3 */
+    {
+        pDblE = new types::Double(pDbl->getCols(), pDbl->getCols());
+    }
+
+    if(_iRetCount >= 4)/* next alloc for Rk needed only for _iRetCount>=4 */
+    {
+        pDblRk = new types::Double(1,1);
+    }
+
+    int iRet = iQrM(pData, pDbl->getRows(), pDbl->getCols(), pDbl->isComplex(), iRowsToCompute, dTol, pdQ, pdR, (pDblE ? pDblE->get() : NULL), (pDblRk ? pDblRk->get() : NULL));
+
+    if(iRet != 0)
+    {
+           ScierrorW(999, _W("%ls: LAPACK error n°%d.\n"), L"qr",iRet);
+        return types::Function::Error;
+    }
+
+    if(pDbl->isComplex())
+    {
+        vGetPointerFromDoubleComplex((doublecomplex*)pdQ, pDblQ->getSize(), pDblQ->getReal(), pDblQ->getImg());
+        vFreeDoubleComplexFromPointer((doublecomplex*)pdQ);
+
+        vGetPointerFromDoubleComplex((doublecomplex*)pdR, pDblR->getSize(), pDblR->getReal(), pDblR->getImg());
+        vFreeDoubleComplexFromPointer((doublecomplex*)pdR);
+    }
+
+    if(pDbl->isComplex())
+    {
+        vFreeDoubleComplexFromPointer((doublecomplex*)pData);
+    }
+
+    out.push_back(pDblQ);
+    if(_iRetCount >= 2)
+    {
+        out.push_back(pDblR);
+    }
+
+    if(_iRetCount == 3)
+    {
+        out.push_back(pDblE);
+    }
+    else if(_iRetCount == 4)
+    {
+        out.push_back(pDblRk);
+        out.push_back(pDblE);
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_rcond.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_rcond.cpp
new file mode 100644 (file)
index 0000000..0c3f09b
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "rcond.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_rcond(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl     = NULL;
+    types::Double* result   = NULL;
+    int iRet                = 0;
+
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"rcond", 1);
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_rcond";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl = in[0]->getAs<types::Double>();
+
+    if(pDbl->getRows() != pDbl->getCols())
+    {
+               ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"rcond", 1);
+        return types::Function::Error;            
+    }
+
+    if(pDbl->getRows() == 0)
+    {
+        out.push_back(types::Double::Empty());
+        return types::Function::OK;
+    }
+    else if(pDbl->getRows() == -1) // manage eye case
+    {
+        out.push_back(new types::Double(1));
+        return types::Function::OK;
+    }
+
+    result = new types::Double(1,1);
+
+    if(pDbl->isComplex())
+    {
+        double* pData = (double*)oGetDoubleComplexFromPointer(pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+        iRet = iRcondM(pData, pDbl->getCols(), true /*isComplex*/, result->get());
+               vFreeDoubleComplexFromPointer((doublecomplex*)pData);
+    }
+    else
+    {
+        iRet = iRcondM(pDbl->get(), pDbl->getCols(), false /*isComplex*/, result->get());
+    }
+
+    if(iRet == -1)
+    {
+               ScierrorW(999, _W("%ls: Allocation failed.\n"), L"rcond");
+        return types::Function::Error;
+    }
+
+    out.push_back(result);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_schur.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_schur.cpp
new file mode 100644 (file)
index 0000000..9333c7a
--- /dev/null
@@ -0,0 +1,417 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+#include "configvariable.hxx"
+#include "callable.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "scischur.h"
+#include "schurSelect.h"
+}
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_schur(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl[2]          = {NULL, NULL};
+    types::String* pStr             = NULL;
+    types::Double* pDblOut[3]       = {NULL, NULL, NULL};
+    types::Callable* pFunction      = NULL;
+    ConfigVariable::EntryPointStr* pStrFunction = NULL;
+
+    int  iCase                      = 1;
+    bool bComplexArgs               = false;
+    bool bIsRealStr                 = false;
+    bool bIsComplexStr              = false;
+    bool bIsContinuStr              = false;
+    bool bIsDiscreteStr             = false;
+
+// *** check number of input args. ***
+    if(in.size() < 1 && in.size() > 3)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"schur", 1, 3);
+        return types::Function::Error;
+    }
+
+// *** check type of input args and get it. ***
+    if(in[0]->isDouble() == false)
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_schur";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+
+    pDbl[0] = in[0]->getAs<types::Double>();
+
+    if(pDbl[0]->getRows() != pDbl[0]->getCols()) // square matrix
+    {
+        ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"schur", 1);
+        return types::Function::Error;
+    }
+
+    if((pDbl[0]->getRows() == -1) || (pDbl[0]->getCols() == -1)) // manage eye case
+    {
+        ScierrorW(271,_W("%ls: Size varying argument a*eye(), (arg %d) not allowed here.\n"), L"schur", 1);
+        return types::Function::Error;
+    }
+
+    pDbl[0] = pDbl[0]->clone()->getAs<types::Double>(); // pDbl will be modified
+
+    if(in.size() > 1)
+    {
+        if(in[1]->isDouble())
+        {
+            pDbl[1] = in[1]->getAs<types::Double>();
+
+            if(pDbl[1]->getRows() != pDbl[1]->getCols()) // square matrix
+            {
+                ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"schur", 2);
+                return types::Function::Error;
+            }
+
+            if((pDbl[1]->getRows() == -1) || (pDbl[1]->getCols() == -1)) // manage eye case
+            {
+                ScierrorW(271,_W("%ls: Size varying argument a*eye(), (arg %d) not allowed here.\n"), L"schur", 2);
+                return types::Function::Error;
+            }
+
+            if(pDbl[0]->getCols() != pDbl[1]->getCols())
+            {
+                ScierrorW(267,_W("%ls: Arg %d and arg %d must have equal dimensions.\n"), L"schur", 1, 2);
+                return types::Function::Error;
+            }
+
+            pDbl[1] = pDbl[1]->clone()->getAs<types::Double>(); // pDbl will be modified
+
+            iCase = 11;
+        }
+        else if(in[1]->isString())
+        {
+            pStr = in[1]->getAs<types::String>();
+            bIsRealStr = !wcscmp(pStr->get(0), L"r") || !wcscmp(pStr->get(0), L"real");
+            bIsComplexStr = !wcscmp(pStr->get(0), L"comp") || !wcscmp(pStr->get(0), L"complex");
+
+            if(bIsComplexStr)
+            {
+                pDbl[0]->setComplex(true); // pDbl[0] is a clone of in[0]
+            }
+
+            if(bIsRealStr || bIsComplexStr)
+            {
+                iCase = 1;
+            }
+            else
+            {
+                iCase = 12;
+            }
+        }
+        else if(in[1]->isCallable())
+        {
+            pFunction = in[1]->getAs<types::Callable>();
+            iCase = 12;
+        }
+        else
+        {
+            std::wstring wstFuncName = L"%"  + in[1]->getShortTypeStr() + L"_schur";
+            return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+        }
+    }
+
+    if(in.size() == 3)
+    {
+        if(in[2]->isString() == false && in[2]->isCallable() == false)
+        {
+            std::wstring wstFuncName = L"%"  + in[2]->getShortTypeStr() + L"_schur";
+            return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+        }
+
+        if(in[2]->isString())
+        {
+            pStr = in[2]->getAs<types::String>();
+        }
+        else
+        {
+            pFunction = in[2]->getAs<types::Callable>();
+        }
+
+        iCase = 112;
+    }
+
+// *** check number of output args according the input args. ***
+
+    // iCase represents the type of args input.
+    // 1 = double, 2 = string, so 112 = double double string.
+    switch(iCase)
+    {
+        case 1: // double
+        {
+            if(_iRetCount > 2)
+            {
+                ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"schur", 1, 2);
+                return types::Function::Error;
+            }
+            break;
+        }
+        case 11: // double double
+        {
+            if(_iRetCount != 2 && _iRetCount != 4)
+            {
+                ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d or %d expected.\n"), L"schur", 2, 4);
+                return types::Function::Error;
+            }
+            break;
+        }
+        case 12: // double string
+        {
+            if(_iRetCount < 2 && _iRetCount > 3)
+            {
+                ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"schur", 2, 3);
+                return types::Function::Error;
+            }
+            break;
+        }
+        default://case 112: // double double string
+        {
+            if(_iRetCount > 4) // in doc, 5 output args are possible ?!?
+            {
+                ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"schur", 1, 4);
+                return types::Function::Error;
+            }
+            break;
+        }
+    }
+
+// *** check empty matrix ***
+
+    // iCase represents the type of args input.
+    // 1 = double, 2 = string, so 112 = double double string.
+    switch(iCase)
+    {
+        case 11: // double double
+        case 1: // double
+        {
+            if(pDbl[0]->getCols() == 0)
+            {
+                for(int i=0; i<_iRetCount; i++)
+                {
+                    out.push_back(types::Double::Empty());
+                }
+                return types::Function::OK;
+            }
+            break;
+        }
+        case 12: // double string
+        {
+            if(pDbl[0]->getCols() == 0)
+            {
+                types::Double* zero = new types::Double(0);
+
+                for(int i = 0; i < _iRetCount; i++)
+                {
+                    if(i == 1 && !bIsComplexStr && !bIsRealStr)
+                    {
+                        out.push_back(zero);
+                    }
+                    else
+                    {
+                        out.push_back(types::Double::Empty());
+                    }
+                }
+                return types::Function::OK;
+            }
+            break;
+        }
+        case 112: // double double string
+        {
+            if(pDbl[0]->getCols() == 0)
+            {
+                types::Double* zero = new types::Double(0);
+
+                for(int i=1; i<_iRetCount; i++)
+                {
+                    out.push_back(types::Double::Empty());
+                }
+
+                if(_iRetCount > 1)
+                {
+                    out.push_back(zero);
+                }
+                else
+                {
+                    out.push_back(types::Double::Empty());
+                }
+
+                return types::Function::OK;
+            }
+            break;
+        }
+    }
+
+// *** perform operations. ***
+
+    bComplexArgs = pDbl[0]->isComplex() || (pDbl[1] && pDbl[1]->isComplex()) || bIsComplexStr;
+
+    if(bIsRealStr && bComplexArgs)
+    {
+        ScierrorW(202,_W("%ls: Wrong type for input argument #%d: Real matrix expected.\n"), L"schur", 1);
+        return types::Function::Error;
+    }
+
+    for(int i = 0; i < 2; i++)
+    {
+        pDblOut[i] = new types::Double(pDbl[0]->getCols(), pDbl[0]->getCols(), bComplexArgs);
+    }
+
+    // iCase represents the type of args input.
+    // 1 = double, 2 = string, so 112 = double double string.
+    switch(iCase)
+    {
+        case 112: // double double string || double double function
+        case 12: // double string || double function
+        {
+            if(pStr)
+            {
+                bIsContinuStr = !wcscmp(pStr->get(0), L"c") ||
+                                !wcscmp(pStr->get(0), L"cont") ||
+                                !wcscmp(pStr->get(0), L"zb02ow") || // two matrix, complex case
+                                !wcscmp(pStr->get(0), L"zb02mv") || // one matrix, complex case
+                                !wcscmp(pStr->get(0), L"sb02ow") || // two matrix, real case
+                                !wcscmp(pStr->get(0), L"sb02mv");   // one matrix, real case
+
+                bIsDiscreteStr = !wcscmp(pStr->get(0), L"d") ||
+                                !wcscmp(pStr->get(0), L"disc") ||
+                                !wcscmp(pStr->get(0), L"zb02ox") || // two matrix, complex case
+                                !wcscmp(pStr->get(0), L"zb02mw") || // one matrix, complex case
+                                !wcscmp(pStr->get(0), L"sb02ox") || // two matrix, real case
+                                !wcscmp(pStr->get(0), L"sb02mw");   // one matrix, real case
+
+                if(bIsContinuStr == false && bIsDiscreteStr == false)
+                {
+                    pStrFunction = ConfigVariable::getEntryPoint(pStr->get(0));
+                    if(pStrFunction == NULL)
+                    {
+                        ScierrorW(999,_W("%ls: Subroutine not found: %ls\n"), L"schur", pStr->get(0));
+                        return types::Function::Error;
+                    }
+                }
+            }
+            else if(pFunction)
+            {
+                ConfigVariable::setSchurFunction(pFunction);
+            }
+
+            pDblOut[2] = new types::Double(1,1); // Dim
+            break;
+        }
+        default:// case 1 and 11
+            break;
+    }
+
+    int iRet = schurSelect(pDbl, pDblOut, bComplexArgs, bIsDiscreteStr, bIsContinuStr, pStrFunction);
+
+    if(iRet)
+    {
+        printf("failed !!!  %d",iRet);
+        return types::Function::Error;
+    }
+
+    // return result(s)
+    switch(iCase)
+    {
+        case 1: // double
+        {
+            if(_iRetCount == 2)
+            {
+                out.push_back(pDblOut[0]);
+            }
+
+            out.push_back(pDbl[0]); // pDbl[0] has been overwritten by its real Schur form T.
+            break;
+        }
+        case 11: // double double
+        {
+            for(int i = 0; i < 2; i++)
+            {
+                out.push_back(pDbl[i]);
+            }
+
+            if(_iRetCount == 4)
+            {
+                out.push_back(pDblOut[0]);
+                if(_iRetCount > 1)
+                {
+                    out.push_back(pDblOut[1]);
+                }
+            }
+
+            break;
+        }
+        case 12: // double string || double function
+        {
+            if(_iRetCount < 2)
+            {
+                out.push_back(pDbl[0]);
+            }
+            else
+            {
+                out.push_back(pDblOut[0]);
+                out.push_back(pDblOut[2]);
+
+                if(_iRetCount == 3)
+                {
+                    out.push_back(pDbl[0]);
+                }
+            }
+            break;
+        }
+        case 112: // double double string || double double function
+        {
+            switch(_iRetCount)
+            {
+                case 0 :
+                case 1 : break; // dim
+                case 4 : // As Es Z dim
+                {
+                    for(int i = 0; i < 2; i++)
+                    {
+                        out.push_back(pDbl[i]);
+                    }
+                    out.push_back(pDblOut[1]);
+                    break;
+                }
+                case 3 : // Q Z dim
+                {
+                    out.push_back(pDblOut[0]);
+                }
+                case 2 : // Z dim
+                {
+                    out.push_back(pDblOut[1]);
+                    break;
+                }
+            }
+            out.push_back(pDblOut[2]);
+            break;
+        }
+    }
+
+    ConfigVariable::setSchurFunction(NULL);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_spec.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_spec.cpp
new file mode 100644 (file)
index 0000000..6a9790c
--- /dev/null
@@ -0,0 +1,475 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "eigen.h"
+#include "issymmetric.h"
+#include "vfinite.h"
+}
+
+bool isNoZeroImag(types::Double* _pDbl);
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_spec(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDblA    = NULL;
+    types::Double* pDblB    = NULL;
+    double* pDataA          = NULL;
+    double* pDataB          = NULL;
+    bool symmetric          = FALSE;
+    int iRet                = 0;
+
+    if((in.size() != 1) && (in.size() != 2))
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"spec", 1, 2);
+        return types::Function::Error;
+    }
+
+    if(_iRetCount > 2*in.size())
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"spec", 1, 2*in.size());
+        return types::Function::Error;
+    }
+
+    if((in[0]->isDouble() == false))
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_spec";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+    pDblA = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>();
+
+    if(pDblA->getCols() != pDblA->getRows())
+    {
+               ScierrorW(20, _W("%ls: Wrong type for argument %d: Square matrix expected.\n"), L"sped", 1);
+        return types::Function::Error;  
+    }
+
+    if((pDblA->getRows() == -1) || (pDblA->getCols() == -1)) // manage eye case
+    {
+        ScierrorW(271,_W("%ls: Size varying argument a*eye(), (arg %d) not allowed here.\n"), L"spec", 1);
+        return types::Function::Error;
+    }
+
+    if((pDblA->getCols() == 0) || (pDblA->getRows() == 0)) // size null
+    {
+        out.push_back(types::Double::Empty());
+        for(int i=1; i < _iRetCount; i++)
+        {
+            out.push_back(types::Double::Empty());
+        }
+        return types::Function::OK;
+    }
+
+    if(in.size() == 1)
+    {
+        types::Double* pDblEigenValues  = NULL;
+        types::Double* pDblEigenVectors = NULL;
+
+        if(pDblA->isComplex())
+        {
+            pDataA = (double*)oGetDoubleComplexFromPointer(pDblA->getReal(), pDblA->getImg(), pDblA->getSize());
+            if(!pDataA)
+            {
+                ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"spec");
+                return types::Function::Error;
+            }
+        }
+        else
+        {
+            pDataA = pDblA->getReal();
+        }
+
+        int totalSize = pDblA->getSize();
+        if((pDblA->isComplex() ? C2F(vfiniteComplex)(&totalSize, (doublecomplex*)pDataA) : C2F(vfinite)(&totalSize, pDataA)) == false)
+        {
+                   ScierrorW(264, _W("%ls: Wrong value for argument %d: Must not contain NaN or Inf.\n"), L"spec", 1);
+            return types::Function::Error;   
+        }
+
+        symmetric = isSymmetric(pDblA->getReal(), pDblA->getImg(), pDblA->isComplex(), pDblA->getRows(), pDblA->getCols()) == 1;
+        int eigenValuesCols = (_iRetCount == 1) ? 1 : pDblA->getCols();
+
+        if(symmetric)
+        {
+            pDblEigenValues = new types::Double(pDblA->getCols(), eigenValuesCols);
+            if(_iRetCount == 2)
+            {
+                pDblEigenVectors = new types::Double(pDblA->getCols(), pDblA->getCols(), pDblA->isComplex());
+            }
+        }
+        else
+        {
+            pDblEigenValues  = new types::Double(pDblA->getCols(), eigenValuesCols, true);
+            if(_iRetCount == 2)
+            {
+                pDblEigenVectors = new types::Double(pDblA->getCols(), pDblA->getCols(), true);
+            }
+        }
+
+        if(pDblA->isComplex())
+        {
+            if(symmetric)
+            {
+                iRet = iEigen1ComplexSymmetricM((doublecomplex*)pDataA, pDblA->getCols(), (_iRetCount == 2), pDblEigenValues->getReal());
+
+                if(iRet < 0)
+                {
+                    ScierrorW(998, _W("%ls: On entry to ZGEEV parameter number  3 had an illegal value (lapack library problem).\n"), L"spec", iRet);
+                    return types::Function::Error;
+                }
+
+                if(iRet > 0)
+                {
+                    ScierrorW(24, _W("%ls: Convergence problem, %d off-diagonal elements of an intermediate tridiagonal form did not converge to zero.\n"), L"spec", iRet);
+                    return types::Function::Error;
+                }
+
+                if(_iRetCount == 2)
+                {
+                    vGetPointerFromDoubleComplex((doublecomplex*)pDataA, pDblA->getSize() , pDblEigenVectors->getReal(), pDblEigenVectors->getImg());
+                    expandToDiagonalOfMatrix(pDblEigenValues->getReal(), pDblA->getCols());
+                    out.push_back(pDblEigenVectors);
+                }
+                out.push_back(pDblEigenValues);
+            }
+            else // not symmetric
+            {
+                doublecomplex* pEigenValues = (doublecomplex*)MALLOC(pDblA->getCols() * sizeof(doublecomplex));
+                doublecomplex* pEigenVectors = pDblEigenVectors ? (doublecomplex*)MALLOC(sizeof(doublecomplex) * pDblA->getSize()) : NULL;
+                iRet = iEigen1ComplexM((doublecomplex*)pDataA, pDblA->getCols(), pEigenValues,pEigenVectors);
+                if(iRet < 0)
+                {
+                    ScierrorW(998, _W("%ls: On entry to ZHEEV parameter number  3 had an illegal value (lapack library problem).\n"), L"spec", iRet);
+                    return types::Function::Error;
+                }
+
+                if(iRet > 0)
+                {
+                    ScierrorW(24, _W("%ls: The QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed. Elements and %d+1:N of W contain eigenvalues which have converged.\n"), L"spec", iRet);
+                    return types::Function::Error;
+                }
+
+                if(_iRetCount == 2)
+                {
+                    expandZToDiagonalOfCMatrix(pEigenValues, pDblA->getCols(), pDblEigenValues->getReal(), pDblEigenValues->getImg());
+                    vGetPointerFromDoubleComplex(pEigenVectors, pDblA->getSize(), pDblEigenVectors->getReal(), pDblEigenVectors->getImg());
+
+                    FREE(pEigenVectors);
+                    out.push_back(pDblEigenVectors);
+                }
+                else
+                {
+                    vGetPointerFromDoubleComplex(pEigenValues, pDblA->getCols(), pDblEigenValues->getReal(), pDblEigenValues->getImg());
+                }
+                out.push_back(pDblEigenValues);
+                FREE(pEigenValues);
+            }
+        }
+        else // real
+        {
+            if(symmetric)
+            {
+                iRet= iEigen1RealSymmetricM(pDataA, pDblA->getCols(), (_iRetCount == 2), pDblEigenValues->getReal());
+
+                if(iRet < 0)
+                {
+                    ScierrorW(998, _W("%ls: On entry to ZGEEV parameter number  3 had an illegal value (lapack library problem).\n"), L"spec", iRet);
+                    return types::Function::Error;
+                }
+
+                if(iRet > 0)
+                {
+                    ScierrorW(24, _W("%ls: Convergence problem, %d off-diagonal elements of an intermediate tridiagonal form did not converge to zero.\n"), L"spec", iRet);
+                    return types::Function::Error;
+                }
+
+                if(_iRetCount == 2)
+                {
+                    expandToDiagonalOfMatrix(pDblEigenValues->getReal(), pDblA->getCols());
+                    out.push_back(pDblA);
+                }
+                out.push_back(pDblEigenValues);
+            }
+            else // not symmetric
+            {
+                iRet = iEigen1RealM(pDataA, pDblA->getCols(), pDblEigenValues->getReal(), pDblEigenValues->getImg(), pDblEigenVectors ? pDblEigenVectors->getReal() : NULL, pDblEigenVectors ? pDblEigenVectors->getImg() : NULL);
+
+                if(iRet < 0)
+                {
+                    ScierrorW(998, _W("%ls: On entry to ZHEEV parameter number  3 had an illegal value (lapack library problem).\n"), L"spec", iRet);
+                    return types::Function::Error;
+                }
+
+                if(iRet > 0)
+                {
+                    ScierrorW(24, _W("%ls: The QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed. Elements and %d+1:N of WR and WI contain eigenvalues which have converged.\n"), L"spec", iRet);
+                    return types::Function::Error;
+                }
+
+                if(_iRetCount == 2)
+                {
+                    expandToDiagonalOfMatrix(pDblEigenValues->getReal(), pDblA->getCols());
+                    expandToDiagonalOfMatrix(pDblEigenValues->getImg(), pDblA->getCols());
+                    out.push_back(pDblEigenVectors);
+                }
+                out.push_back(pDblEigenValues);
+            }
+        }
+    }
+
+    if(in.size() == 2)
+    {
+        types::Double* pDblL            = NULL;
+        types::Double* pDblR            = NULL;
+        types::Double* pDblBeta         = NULL;
+        types::Double* pDblAlpha        = NULL;
+        doublecomplex* pL               = NULL;
+        doublecomplex* pR               = NULL;
+        doublecomplex* pBeta            = NULL;
+        doublecomplex* pAlpha           = NULL;
+        bool bIsComplex                 = false;
+
+        if((in[1]->isDouble() == false))
+        {
+            std::wstring wstFuncName = L"%"  + in[1]->getShortTypeStr() + L"_spec";
+            return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+        }
+        pDblB = in[1]->getAs<types::Double>()->clone()->getAs<types::Double>();
+        if((pDblA->getRows() != pDblB->getRows()) && (pDblA->getCols() != pDblB->getCols()))
+        {
+            ScierrorW(999, _W("%ls: Arguments %d and %d must have equal dimensions.\n"), L"spec", 1, 2);
+            return types::Function::Error;
+        }
+
+        //chekc if A and B are real complex or with imamg part at 0
+        if(isNoZeroImag(pDblA) == false && isNoZeroImag(pDblB) == false)
+        {//view A and B as real matrix
+            bIsComplex = false;
+        }
+        else
+        {
+            bIsComplex = pDblA->isComplex() || pDblB->isComplex();
+        }
+
+        if(bIsComplex)
+        {
+            if(pDblA->isComplex() == false)
+            {
+                pDblA->setComplex(true);
+            }
+
+            if(pDblB->isComplex() == false)
+            {
+                pDblB->setComplex(true);
+            }
+
+            pDataA = (double*)oGetDoubleComplexFromPointer(pDblA->getReal(), pDblA->getImg(), pDblA->getSize());
+            pDataB = (double*)oGetDoubleComplexFromPointer(pDblB->getReal(), pDblB->getImg(), pDblB->getSize());
+
+            if(!pDblA || !pDblB)
+            {
+                ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"spec");
+                return types::Function::Error;
+            }
+        }
+        else
+        {
+            pDataA = pDblA->getReal();
+            pDataB = pDblB->getReal();
+        }
+
+        int totalSize = pDblA->getSize();
+
+        if((pDblA->isComplex() ? C2F(vfiniteComplex)(&totalSize, (doublecomplex*)pDataA) : C2F(vfinite)(&totalSize, pDataA)) == false)
+        {
+                   ScierrorW(264, _W("%ls: Wrong value for argument %d: Must not contain NaN or Inf.\n"), L"spec", 1);
+            return types::Function::Error;   
+        }
+
+        if((pDblB->isComplex() ? C2F(vfiniteComplex)(&totalSize, (doublecomplex*)pDataB) : C2F(vfinite)(&totalSize, pDataB)) == false)
+        {
+                   ScierrorW(264, _W("%ls: Wrong value for argument %d: Must not contain NaN or Inf.\n"), L"spec", 2);
+            return types::Function::Error;   
+        }
+
+        switch(_iRetCount)
+        {
+            case 4:
+            {
+                pDblL = new types::Double(pDblA->getRows(), pDblA->getCols(), true);
+                if(bIsComplex)
+                {
+                    pL = (doublecomplex*)MALLOC(pDblA->getSize() * sizeof(doublecomplex));
+                }
+            }
+            case 3:
+            {
+                pDblR = new types::Double(pDblA->getRows(), pDblA->getCols(), true);
+                if(bIsComplex)
+                {
+                    pR = (doublecomplex*)MALLOC(pDblA->getSize() * sizeof(doublecomplex));
+                }
+            }
+            case 2:
+            {
+                if(bIsComplex)
+                {
+                    pBeta = (doublecomplex*)MALLOC(pDblA->getCols() * sizeof(doublecomplex));
+                }
+                pDblBeta = new types::Double(pDblA->getCols(), 1, pBeta ? true : false);
+            }
+            default : // case 1:
+            {
+                if(bIsComplex)
+                {
+                    pAlpha = (doublecomplex*)MALLOC(pDblA->getCols() * sizeof(doublecomplex));
+                }
+                pDblAlpha = new types::Double(pDblA->getCols(), 1, true);
+            }
+        }
+
+        if(bIsComplex)
+        {
+            iRet = iEigen2ComplexM((doublecomplex*)pDataA, (doublecomplex*)pDataB, pDblA->getCols(), pAlpha, pBeta, pR, pL);
+        }
+        else
+        {
+            iRet = iEigen2RealM(    pDataA, pDataB, pDblA->getCols(), 
+                                    pDblAlpha->getReal(), pDblAlpha->getImg(), 
+                                    pDblBeta ? pDblBeta->getReal()  : NULL, 
+                                    pDblR    ? pDblR->getReal()     : NULL, 
+                                    pDblR    ? pDblR->getImg()      : NULL, 
+                                    pDblL    ? pDblL->getReal()     : NULL,
+                                    pDblL    ? pDblL->getImg()      : NULL);
+        }
+
+        if(iRet > 0)
+        {
+            sciprint(_("Warning :\n"));
+            sciprint(_("Non convergence in the QZ algorithm.\n"));
+            sciprint(_("The top %d  x %d blocks may not be in generalized Schur form.\n"), iRet);
+        }
+
+        if(iRet < 0)
+        {
+            ScierrorW(998, _W("%ls: On entry to ZHEEV parameter number  3 had an illegal value (lapack library problem).\n"), L"spec", iRet);
+            return types::Function::Error;
+        }
+
+        if(iRet > 0)
+        {
+            if(bIsComplex)
+            {
+                if(iRet <= pDblA->getCols())
+                {
+                    ScierrorW(24, _W("%ls: The QZ iteration failed in DGGEV.\n"), L"spec");
+                }
+                else
+                {
+                    if(iRet ==  pDblA->getCols()+1) ScierrorW(999, _W("%ls: Other than QZ iteration failed in DHGEQZ.\n"), L"spec");
+                    if(iRet ==  pDblA->getCols()+2) ScierrorW(999, _W("%ls: Error return from DTGEVC.\n"), L"spec");
+                }
+            }
+            else
+            {
+                ScierrorW(24, _W("%ls: The QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed. Elements and %d+1:N of W contain eigenvalues which have converged.\n"), L"spec", iRet);
+            }
+            return types::Function::Error;
+        }
+
+        if(bIsComplex)
+        {
+            switch(_iRetCount)
+            {
+                case 4: vGetPointerFromDoubleComplex(pL, pDblA->getSize(), pDblL->getReal(), pDblL->getImg());
+                case 3: vGetPointerFromDoubleComplex(pR, pDblA->getSize(), pDblR->getReal(), pDblR->getImg());
+                case 2: vGetPointerFromDoubleComplex(pBeta, pDblA->getCols(), pDblBeta->getReal(), pDblBeta->getImg());
+                default : // case 1:
+                    vGetPointerFromDoubleComplex(pAlpha, pDblA->getCols(), pDblAlpha->getReal(), pDblAlpha->getImg());
+            }
+        }
+
+        switch(_iRetCount)
+        {
+            case 1:
+            {
+                out.push_back(pDblAlpha);
+                break;
+            }
+            case 2:
+            {
+                out.push_back(pDblAlpha);
+                out.push_back(pDblBeta);
+                break;
+            }
+            case 3:
+            {
+                out.push_back(pDblAlpha);
+                out.push_back(pDblBeta);
+                out.push_back(pDblR);
+                break;
+            }
+            case 4:
+            {
+                out.push_back(pDblAlpha);
+                out.push_back(pDblBeta);
+                out.push_back(pDblL);
+                out.push_back(pDblR);
+            }
+        }
+
+        if(pAlpha)
+                   vFreeDoubleComplexFromPointer(pAlpha);
+        if(pBeta)
+                   vFreeDoubleComplexFromPointer(pBeta);
+        if(pL)
+                   vFreeDoubleComplexFromPointer(pL);
+        if(pR)
+                   vFreeDoubleComplexFromPointer(pR);
+        if(pDblB->isComplex())
+            vFreeDoubleComplexFromPointer((doublecomplex*)pDataB);
+
+    } // if(in.size() == 2)
+
+    if(pDblA->isComplex())
+    {
+        vFreeDoubleComplexFromPointer((doublecomplex*)pDataA);
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+bool isNoZeroImag(types::Double* _pDbl)
+{      
+    double* pdbl = _pDbl->getImg();
+    for(int i = 0 ; i < _pDbl->getSize() ; i++)
+       {
+               if (pdbl[i])
+               {
+                       return true;
+               }
+       }
+       return false;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/linear_algebra/sci_gateway/cpp/sci_svd.cpp b/scilab/modules/linear_algebra/sci_gateway/cpp/sci_svd.cpp
new file mode 100644 (file)
index 0000000..595cf0a
--- /dev/null
@@ -0,0 +1,238 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY
+* 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 "linear_algebra_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "svd.h"
+}
+/*--------------------------------------------------------------------------*/
+/*
+  s=svd(X): [R: min(rows, cols) x 1]
+  [U,S,V]=svd(X) [U,S,V]:  [ [C|R: rows x rows], [R: rows x cols ],  [R|C: cols x cols ] ]
+  [U,S,V]=svd(X,0) (obsolete) [U,S,V]=svd(X,"e"): [ [C|R:rows x min(rows,cols)], [R: min(rows,cols) x min(rows,cols)], [C|R:cols x min(rows,cols)] ]
+  [U,S,V,rk]=svd(X [,tol]) : cf. supra, rk[R 1 x 1]
+
+  /!\ Contrary to specifications (@ http://www.scilab.org/product/man/svd.html )
+  , previous version was accepting Lhs==2. Worse : tests were using this undocumented behavior.
+  implementation and tests have been fixed according to the specification.
+
+*/
+extern "C"
+{
+    extern int C2F(vfinite)(int *n, double *v);
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_svd(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pDbl     = NULL;
+    types::Double* ptrsU    = NULL;
+    types::Double* ptrsV    = NULL;
+    types::Double* ptrS     = NULL;
+    types::Double* pRk      = NULL;
+    types::Double* pSV      = NULL;
+    double* pData           = NULL;
+    int economy             = 0;
+    int totalsize           = 0;
+    int iRet                = 0;
+    double tol              = 0.;
+
+    if(in.size() != 1 && in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"svd", 1, 2);
+        return types::Function::Error;
+    }
+    if(_iRetCount > 4 || _iRetCount == 2)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d, %d or %d expected.\n"), L"svd", 1, 3, 4);
+        return types::Function::Error;
+    }
+
+    if(in[0]->isDouble() == false)
+    {
+        std::wstring wstFuncName = L"%"  + in[0]->getShortTypeStr() + L"_svd";
+        return Overload::call(wstFuncName, in, _iRetCount, out, new ExecVisitor());
+    }
+    pDbl = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>();
+
+    if(in.size() == 2)
+    {
+        if(in[1]->isString() == true)
+        {
+            if(_iRetCount == 4)
+            {
+                ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d or %d expected.\n"), L"svd", 1, 3);
+                return types::Function::Error;
+            }
+            types::String* pStr = in[1]->getAs<types::String>();
+            if((wcslen(pStr->get(0)) == 1) && (pStr->get(0)[0] == L'e'))
+            {
+                economy = 1;
+            }
+        }
+        if(in[1]->isDouble() == true)
+        {
+            /* no further testing for "old Economy size:  [U,S,V]=svd(A,0) " */
+            if(_iRetCount == 3)
+            {
+                economy = 1;
+            }
+        }
+    }
+
+    if(pDbl->getRows() == 0) /* empty matrix */
+    {
+        for(int i=0; i<_iRetCount-1; i++)
+        {
+            out.push_back(types::Double::Empty());
+        }
+
+        if(_iRetCount == 4)
+        {
+            types::Double* pDZero = new types::Double(1,1);
+            pDZero->set(0,0);
+            out.push_back(pDZero);
+        }
+        else
+        {
+            out.push_back(types::Double::Empty());
+        }
+        return types::Function::OK;
+    }
+
+    if((pDbl->getRows() == -1) || (pDbl->getCols() == -1)) // manage eye case
+    {
+        ScierrorW(271,_W("%ls: Size varying argument a*eye(), (arg %d) not allowed here.\n"), L"svd", 1);
+        return types::Function::Error;
+    }
+
+    if(pDbl->isComplex())
+    {
+        pData = (double *)oGetDoubleComplexFromPointer(pDbl->getReal(), pDbl->getImg(), pDbl->getSize());
+    }
+    else
+    {
+        pData = pDbl->get();
+    }
+
+    totalsize = pDbl->getSize() * (pDbl->isComplex() ? 2 : 1);
+    if(C2F(vfinite)(&totalsize, pData) == false)
+    {
+        ScierrorW(264,_W("%ls: Wrong value for argument %d: Must not contain NaN or Inf.\n"), L"svd", 1);
+        return types::Function::Error;
+    }
+
+    switch(_iRetCount)
+    {
+        case 0:
+        case 1:
+        {
+            pSV = new types::Double(Min(pDbl->getRows(),pDbl->getCols()), 1, false);
+            iRet = iSvdM(pData, pDbl->getRows(), pDbl->getCols(), pDbl->isComplex(), economy, tol, pSV->get(), NULL, NULL, NULL, NULL);
+        }
+        break;
+        case 4:
+        {
+            if((in.size() == 2) && (in[1]->isDouble()))
+            {
+                tol = in[1]->getAs<types::Double>()->get(0);
+            }
+            pRk = new types::Double(1,1,false);
+        }
+        case 3:
+        {
+            int economyRows = economy ? Min(pDbl->getRows(), pDbl->getCols()) : pDbl->getRows();
+            int economyCols = economy ? Min(pDbl->getRows(), pDbl->getCols()) : pDbl->getCols();
+
+            ptrsU = new types::Double(pDbl->getRows(), economyRows, pDbl->isComplex());
+            ptrS  = new types::Double(economyRows, economyCols, false);
+            ptrsV = new types::Double(pDbl->getCols(), economyCols, pDbl->isComplex());
+
+            if(pDbl->isComplex())
+            {
+                double* U = (double*)MALLOC(pDbl->getRows()* economyRows * sizeof(doublecomplex));
+                double* V = (double*)MALLOC(pDbl->getCols()* economyCols * sizeof(doublecomplex));
+
+                iRet = iSvdM(pData, pDbl->getRows(), pDbl->getCols(), true /*isComplex*/, economy, tol, NULL, U, ptrS->get(), V, (pRk ? pRk->get() : NULL));
+                
+                vGetPointerFromDoubleComplex((doublecomplex*)U, ptrsU->getSize(), ptrsU->getReal(), ptrsU->getImg());
+                vFreeDoubleComplexFromPointer((doublecomplex*)U);
+                vGetPointerFromDoubleComplex((doublecomplex*)V, ptrsV->getSize(), ptrsV->getReal(), ptrsV->getImg());
+                vFreeDoubleComplexFromPointer((doublecomplex*)V);
+            }
+            else
+            {
+                iRet = iSvdM(pData, pDbl->getRows(), pDbl->getCols(), false /*isComplex*/, economy, tol, NULL, ptrsU->get(), ptrS->get(), ptrsV->get(), (pRk ? pRk->get() : NULL));
+            }
+        }
+        break;
+       // default: // makes at the beginning of this gateway
+    }
+
+    if(iRet != 0)
+    {
+        if(iRet == -1)
+        {
+            ScierrorW(999,_W("%ls: Cannot allocate more memory.\n"),L"svd");
+        }
+        else
+        {
+            ScierrorW(24,_W("%ls: Convergence problem...\n"),L"svd");
+        }
+        return types::Function::Error;
+    }
+
+    if(pDbl->isComplex())
+    {
+        vFreeDoubleComplexFromPointer((doublecomplex*)pData);
+    }
+
+    switch(_iRetCount)
+    {
+        case 0:
+        case 1:
+        {
+            out.push_back(pSV);
+        }
+        break;
+        case 3:
+        {
+            out.push_back(ptrsU);
+            out.push_back(ptrS);
+            out.push_back(ptrsV);
+        }
+        break;
+        case 4:
+        {
+            out.push_back(ptrsU);
+            out.push_back(ptrS);
+            out.push_back(ptrsV);
+            out.push_back(pRk);
+        }
+        break;
+       // default: // makes at the beginning of this gateway
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
index 745f48b..0e21849 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2009 - DIGITEO - Bernard HUGUENEY 
+ * 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
@@ -28,8 +29,7 @@ static int assembleEigenvectorsInPlace(int iRows, double * eigenvaluesImg, doubl
 static int iEigen2Complex(doublecomplex* pData1, doublecomplex* pData2, int iCols, doublecomplex* pAlpha, doublecomplex* pBeta
                   , doublecomplex* pR, doublecomplex* pL, doublecomplex* pWork, int iWorkSize, double* pRWork);
 
-static int iEigen2Real(double* pData1, double* pData2, int iCols, double* pAlphaReal, double* pAlphaImg, double* pBeta
-               , double* pR, double* pL, double* pWork, int iWorkSize);
+static int iEigen2Real(double* pData1, double* pData2, int iCols, double* pAlphaReal, double* pAlphaImg, double* pBeta, double* pR, double* pL, double* pWork, int iWorkSize);
 
 static double* allocateDggevWorkspace(int iCols, int* pWorksize);
 
@@ -349,43 +349,49 @@ void expandZToDiagonalOfCMatrix(doublecomplex const* pZVector, int iCols, double
  */
 static double* allocateDggevWorkspace(int iCols, int* pWorksize)
 {
-  double* ret=NULL;
-  int info;
-  int query= -1; 
-  double opt;
-  C2F(dggev)("N", "N", &iCols, NULL, &iCols, NULL, &iCols, NULL, NULL, NULL, NULL, &iCols, NULL, &iCols, &opt, &query, &info);
-  *pWorksize= (int)opt;
-  ret= MALLOC(*pWorksize);
-  if(!ret)
+    double* ret=NULL;
+    int info;
+    int query= -1; 
+    double opt;
+
+    C2F(dggev)("N", "N", &iCols, NULL, &iCols, NULL, &iCols, NULL, NULL, NULL, NULL, &iCols, NULL, &iCols, &opt, &query, &info);
+
+    *pWorksize= (int)opt;
+    ret= MALLOC(*pWorksize * sizeof(double));
+
+    if(!ret)
     {
-      *pWorksize= Max(1, 8*iCols);
-      ret= MALLOC(*pWorksize);
-      if(!ret)
-       {
-         *pWorksize= 0;
-       }
+        *pWorksize = Max(1, 8*iCols);
+        ret= MALLOC(*pWorksize * sizeof(double));
+        if(!ret)
+        {
+            *pWorksize= 0;
+        }
     }
-  return ret;
+    return ret;
 }
 static doublecomplex* allocateZggevWorkspace(int iCols, int* pWorksize)
 {
-  doublecomplex* ret=NULL;
-  int info;
-  int query= -1; 
-  doublecomplex opt;
-  C2F(zggev)("N", "N", &iCols, NULL, &iCols, NULL, &iCols, NULL, NULL, NULL, &iCols, NULL, &iCols, &opt, &query, NULL, &info);
-  *pWorksize= (int) opt.r;
-  ret= MALLOC(*pWorksize);
-  if(!ret)
+    doublecomplex* ret=NULL;
+    int info;
+    int query= -1; 
+    doublecomplex opt;
+
+    C2F(zggev)("N", "N", &iCols, NULL, &iCols, NULL, &iCols, NULL, NULL, NULL, &iCols, NULL, &iCols, &opt, &query, NULL, &info);
+
+    *pWorksize= (int) opt.r;
+    ret= MALLOC(*pWorksize * sizeof(double));
+
+    if(!ret)
     {
-      *pWorksize= Max(1, 8*iCols);
-      ret= MALLOC(*pWorksize);
-      if(!ret)
-       {
-         *pWorksize= 0;
-       }
+        *pWorksize = Max(1, 8*iCols);
+        ret= MALLOC(*pWorksize * sizeof(double));
+        if(!ret)
+        {
+            *pWorksize= 0;
+        }
     }
-  return ret;
+    return ret;
 }
 
 /*
@@ -415,103 +421,103 @@ static doublecomplex* allocateZggevWorkspace(int iCols, int* pWorksize)
  * @param pRWork double* scratch workspace : only used for complex data
  */
 
-static int iEigen2Complex(doublecomplex* pData1, doublecomplex* pData2, int iCols, doublecomplex* pAlpha, doublecomplex* pBeta
-                  , doublecomplex* pR, doublecomplex* pL, doublecomplex* pWork, int iWorkSize, double* pRWork)
+static int iEigen2Complex(doublecomplex* pData1, doublecomplex* pData2, int iCols, doublecomplex* pAlpha, doublecomplex* pBeta, doublecomplex* pR, doublecomplex* pL, doublecomplex* pWork, int iWorkSize, double* pRWork)
 {
-  int info;
-  C2F(zggev)((pL != NULL) ? "V" : "N", (pR != NULL) ? "V" : "N", &iCols, pData1, &iCols, pData2, &iCols, pAlpha, pBeta
-            , pL, &iCols, pR, &iCols, pWork, &iWorkSize, pRWork, &info);
-  return info;
+    int info;
+    C2F(zggev)((pL != NULL) ? "V" : "N", (pR != NULL) ? "V" : "N", &iCols, pData1, &iCols, pData2, &iCols, pAlpha, pBeta, pL, &iCols, pR, &iCols, pWork, &iWorkSize, pRWork, &info);
+    return info;
 }
 
-static int iEigen2Real(double* pData1, double* pData2, int iCols, double* pAlphaReal, double* pAlphaImg, double* pBeta
-           , double* pR, double* pL, double* pWork, int iWorkSize)
+static int iEigen2Real(double* pData1, double* pData2, int iCols, double* pAlphaReal, double* pAlphaImg, double* pBeta, double* pR, double* pL, double* pWork, int iWorkSize)
 {
-  int info;
-  C2F(dggev)((pL != NULL) ? "V" : "N", (pR != NULL) ? "V" : "N", &iCols, pData1, &iCols, pData2, &iCols, pAlphaReal, pAlphaImg
-            , pBeta, pL, &iCols, pR, &iCols, pWork, &iWorkSize, &info);
-  return info;
+    int info;
+    C2F(dggev)((pL != NULL) ? "V" : "N", (pR != NULL) ? "V" : "N", &iCols, pData1, &iCols, pData2, &iCols, pAlphaReal, pAlphaImg, pBeta, pL, &iCols, pR, &iCols, pWork, &iWorkSize, &info);
+    return info;
 }
 
 /******************************************************************************
  * Part of the API: cf eigen.h
  ******************************************************************************/
-int iEigen2ComplexM(doublecomplex* pData1, doublecomplex* pData2, int iCols
-             , doublecomplex* pAlpha, doublecomplex* pBeta, doublecomplex* pR, doublecomplex* pL)
+int iEigen2ComplexM(doublecomplex* pData1, doublecomplex* pData2, int iCols, doublecomplex* pAlpha, doublecomplex* pBeta, doublecomplex* pR, doublecomplex* pL)
 {
-  int ret= 0;
-  int iRWorkSize= 0;
-  int worksize;
-  double* pRWork= NULL;
-  doublecomplex* pWork=NULL;  
-  int onlyOneLhs= (pBeta == NULL); /* if beta was not requested (only one lhs), memory was not provided for beta, but will be needed to scale alpha */
-
-  iRWorkSize = Max(1,8*iCols);
-  ret=  ( (pBeta= (onlyOneLhs ? (doublecomplex*)MALLOC(iCols * sizeof(doublecomplex)) : pBeta)) == NULL) 
-    || ( (pRWork = (double*)MALLOC(iRWorkSize * sizeof(double) )) == NULL)
-    || ( (pWork= allocateZggevWorkspace(iCols, &worksize)) == NULL );
-  ret= ret 
-    ? -1 /* use explicit -1 to signal malloc error as >0 codes are used for convergence troubles */
-    : iEigen2Complex(pData1, pData2, iCols, pAlpha, pBeta, pR, pL, pWork, worksize, pRWork)
-    ;
-  if((ret >=0) && (ret <= iCols) && onlyOneLhs)
+    int ret= 0;
+    int iRWorkSize= 0;
+    int worksize;
+    double* pRWork= NULL;
+    doublecomplex* pWork=NULL;  
+    int onlyOneLhs= (pBeta == NULL); /* if beta was not requested (only one lhs), memory was not provided for beta, but will be needed to scale alpha */
+    iRWorkSize = Max(1,8*iCols);
+
+    ret =   ((pBeta = (onlyOneLhs ? (doublecomplex*)MALLOC(iCols * sizeof(doublecomplex)) : pBeta)) == NULL) 
+         || ((pRWork = (double*)MALLOC(iRWorkSize * sizeof(double))) == NULL)
+         || ((pWork = allocateZggevWorkspace(iCols, &worksize)) == NULL);
+
+    /* use explicit -1 to signal malloc error as >0 codes are used for convergence troubles */
+    ret = ret ? -1 : iEigen2Complex(pData1, pData2, iCols, pAlpha, pBeta, pR, pL, pWork, worksize, pRWork);
+
+    if((ret >=0) && (ret <= iCols) && onlyOneLhs)
     {/* no error, maybe warnings  and only one lhs : adjust alpha */
-      int ierr; /* original code doe not check ierr */
-      int const delta= sizeof(doublecomplex)/sizeof(double); /* in fact it's (&pAlpha[1].r - &pAlpha[1].r) / sizeof(double), or... 2 :) */
-      C2F(wwrdiv)(&pAlpha[0].r, &pAlpha[0].i, &delta, &pBeta[0].r, &pBeta[0].i, &delta, &pAlpha[0].r, &pAlpha[0].i, &delta, &iCols, &ierr);
+        int ierr; /* original code doe not check ierr */
+
+        /* in fact it's (&pAlpha[1].r - &pAlpha[1].r) / sizeof(double), or... 2 :) */
+        int const delta= sizeof(doublecomplex)/sizeof(double);
+
+        C2F(wwrdiv)(&pAlpha[0].r, &pAlpha[0].i, &delta, &pBeta[0].r, &pBeta[0].i, &delta, &pAlpha[0].r, &pAlpha[0].i, &delta, &iCols, &ierr);
     }
-  FREE(pRWork);
-  FREE(pWork);
-  if(onlyOneLhs)
+
+    FREE(pRWork);
+    FREE(pWork);
+
+    if(onlyOneLhs)
     {
-      FREE(pBeta);
+        FREE(pBeta);
     }
-  return ret;
+    return ret;
 }
 
 /******************************************************************************
  * Part of the API: cf eigen.h
  ******************************************************************************/
-int iEigen2RealM(double* pData1, double* pData2, int iCols, double* pAlphaReal, double* pAlphaImg, double* pBeta
-            , double* pRReal, double* pRImg, double* pLReal, double* pLImg)
+int iEigen2RealM(double* pData1, double* pData2, int iCols, double* pAlphaReal, double* pAlphaImg, double* pBeta, double* pRReal, double* pRImg, double* pLReal, double* pLImg)
 {
-  int ret= 0;
-  int worksize;
-  double* pWork=NULL;  
-
-  int onlyOneLhs= (pBeta == NULL);
-  ret=  ( (pBeta= (onlyOneLhs ? (double*)MALLOC(iCols * sizeof(double)) : pBeta)) == NULL)
-    || ( (pWork= allocateDggevWorkspace(iCols, &worksize)) == NULL );
-  ret= ret 
-    ? -1 /* use explicit -1 to signal malloc error as >0 codes are used for convergence troubles */
-    : iEigen2Real(pData1, pData2, iCols, pAlphaReal, pAlphaImg, pBeta, pRReal, pLReal, pWork, worksize)
-    ;
-  if((ret >=0) && (ret <= iCols) )
-    {/* no error, maybe warnings  and only one lhs : adjust alpha */
-      if(onlyOneLhs)
-       {
-         int i;
-         for(i= 0; i!=iCols; ++i)
-           {
-             pAlphaReal[i] /= pBeta[i];
-             pAlphaImg[i] /= pBeta[i];
-           }
-       }
-      if(pRReal)
-       {
-         assembleEigenvectorsInPlace(iCols, pAlphaImg, pRReal, pRImg);
-       }
-      if(pLReal)
-       {
-         assembleEigenvectorsInPlace(iCols, pAlphaImg, pLReal, pLImg);
-       }
+    int ret = 0;
+    int worksize;
+    double* pWork = NULL;  
+    int onlyOneLhs = (pBeta == NULL);
+
+    ret =   ((pBeta = (onlyOneLhs ? (double*)MALLOC(iCols * sizeof(double)) : pBeta)) == NULL)
+        ||  ((pWork = allocateDggevWorkspace(iCols, &worksize)) == NULL);
+
+    // use explicit -1 to signal malloc error as >0 codes are used for convergence troubles 
+    ret = ret ? -1 : iEigen2Real(pData1, pData2, iCols, pAlphaReal, pAlphaImg, pBeta, pRReal, pLReal, pWork, worksize);
+
+    if((ret >= 0) && (ret <= iCols))
+    {// no error, maybe warnings  and only one lhs : adjust alpha
+        if(onlyOneLhs)
+        {
+            int i;
+            for(i= 0; i!=iCols; ++i)
+            {
+                pAlphaReal[i] /= pBeta[i];
+                pAlphaImg[i] /= pBeta[i];
+            }
+        }
+        if(pRReal)
+        {
+            assembleEigenvectorsInPlace(iCols, pAlphaImg, pRReal, pRImg);
+        }
+        if(pLReal)
+        {
+            assembleEigenvectorsInPlace(iCols, pAlphaImg, pLReal, pLImg);
+        }
     }
-  FREE(pWork);
-  if(onlyOneLhs)
+
+    FREE(pWork);
+    if(onlyOneLhs)
     {
-      FREE(pBeta);
+        FREE(pBeta);
     }
-  return ret;
+    return ret;
 }
 
 
index 442e1e1..e7a49f0 100644 (file)
@@ -49,86 +49,114 @@ int iInvertMatrix(int iRows, int iCols, double* pData, int complexArg
   TODO replace ugly constant 17 with properly #define d (enum ed ? ) constant
   for malloc error.
 */
-int iInvertMatrixM(int iRows, int iCols, double* pData, int complexArg
-                  , double* pdblRcond){
-  int ret=0;
-  int* piPivot=(int*)MALLOC(iCols*sizeof(int));
-  if(piPivot){
-    int iWorkSize= Max(1, 4*iCols);
-    void* pWork= complexArg
-      ? MALLOC(iWorkSize*sizeof(doublecomplex))
-      : MALLOC(iCols*sizeof(int));
-    if(pWork){
-      double* pdblWork=(double*)MALLOC(iWorkSize*sizeof(double) *(complexArg  ? 2: 1));
-
-      if(pdblWork){
-       ret = iInvertMatrix(iRows, iCols, pData, complexArg, pdblRcond, piPivot
-                           , pWork, iWorkSize, pdblWork);
-       FREE(pdblWork);
-      }else{
-       ret = 17;// TODO: this is not a stack allocation pb anymore because we (tried to) use the heap
-      }
-      FREE(pWork);
-    }else{// pWork alloc did not succeed
-      ret = 17;
+int iInvertMatrixM(int iRows, int iCols, double* pData, int complexArg, double* pdblRcond)
+{
+    int ret = 0;
+    int* piPivot = (int*)MALLOC(iCols*sizeof(int));
+    if(piPivot)
+    {
+        int iWorkSize = Max(1, 4*iCols);
+        void* pWork = NULL;
+        if(complexArg)
+        {
+            pWork = MALLOC(iWorkSize*sizeof(doublecomplex));
+        }
+        else
+        {
+            pWork = MALLOC(iCols*sizeof(int));
+        }
+
+        if(pWork)
+        {
+            double* pdblWork = (double*)MALLOC(iWorkSize * sizeof(double) * (complexArg  ? 2 : 1));
+
+            if(pdblWork)
+            {
+                ret = iInvertMatrix(iRows, iCols, pData, complexArg, pdblRcond, piPivot, pWork, iWorkSize, pdblWork);
+                FREE(pdblWork);
+            }
+            else
+            {
+                ret = 17;// TODO: this is not a stack allocation pb anymore because we (tried to) use the heap
+            }
+            FREE(pWork);
+        }
+        else
+        {// pWork alloc did not succeed
+            ret = 17;
+        }
+        FREE(piPivot);
     }
-    FREE(piPivot);
-  }else{ // piPivot alloc did not succeed
-    ret = 17;
-  }
-  return ret;
+    else
+    { // piPivot alloc did not succeed
+        ret = 17;
+    }
+    return ret;
 }
 
-int iInvertMatrix(int iRows, int iCols, double* pData, int complexArg
-                 , double * pdblRcond, int* piPivot, void* pWork
-                 , int iWorkSize, double* pdblWork){
-  int iInfo;
-  int ret = 0; // >0 erreur <0 warning
-  /* ANORM = dlange( '1', M, N, stk(lA), M, stk(lDWORK) )
-     computes  one norm of a matrix (maximum column sum)
-     last work area is not used for norm '1'
-     see http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.essl44.guideref.doc/am501_llange.html
-  */
-  /* using "1" to pass '1' to Fortran ("by ref"->pointer to char)*/
-  double dblAnorm = complexArg
-    ?  C2F(zlange)("1", &iRows, &iCols, pData, &iRows, NULL /*see comment above */)
-    : C2F(dlange)("1", &iRows, &iCols, pData, &iRows,pdblWork/*see above*/);
-  if(complexArg){
-    C2F(zgetrf)(&iRows, &iCols, pData, &iCols, piPivot, &iInfo);
-  }else{
-    C2F(dgetrf)(&iRows, &iCols, pData, &iCols, piPivot, &iInfo);
-  }
-  if(iInfo !=0)
-    {
-      if(iInfo >0)
-       {
-         ret = 19;
-       }
-    }else{
-    *pdblRcond = 0.;
+int iInvertMatrix(int iRows, int iCols, double* pData, int complexArg, double * pdblRcond, int* piPivot, void* pWork, int iWorkSize, double* pdblWork)
+{
+    int iInfo;
+    int ret = 0; // >0 erreur <0 warning
+    /* ANORM = dlange( '1', M, N, stk(lA), M, stk(lDWORK) )
+    computes  one norm of a matrix (maximum column sum)
+    last work area is not used for norm '1'
+    see http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.essl44.guideref.doc/am501_llange.html
+    */
+    /* using "1" to pass '1' to Fortran ("by ref"->pointer to char)*/
+    double dblAnorm  = 0;
     if(complexArg)
-      {
-       C2F(zgecon)("1", &iCols, pData, &iCols, &dblAnorm, pdblRcond, pdblWork
-                   , (double*)pWork, &iInfo);
-      }
+    {
+        dblAnorm = C2F(zlange)("1", &iRows, &iCols, pData, &iRows, NULL /*see comment above */);
+    }
     else
-      {
-       C2F(dgecon)("1", &iCols, pData, &iCols, &dblAnorm, pdblRcond, pdblWork
-                   , (int*)pWork, &iInfo);
-      }
-    if(*pdblRcond <= sqrt(C2F(dlamch)("e",1L))){ ret = -1; }
+    {
+        dblAnorm = C2F(dlange)("1", &iRows, &iCols, pData, &iRows,pdblWork/*see above*/);
+    }
+
     if(complexArg)
-      {
-       C2F(zgetri)( &iCols, (doublecomplex*)pData, &iCols, piPivot, (doublecomplex*)pdblWork, &iWorkSize
-                    , &iInfo);
-      }
+    {
+        C2F(zgetrf)(&iRows, &iCols, pData, &iCols, piPivot, &iInfo);
+    }
+    else
+    {
+        C2F(dgetrf)(&iRows, &iCols, pData, &iCols, piPivot, &iInfo);
+    }
+
+    if(iInfo !=0)
+    {
+        if(iInfo >0)
+        {
+            ret = 19;
+        }
+    }
     else
-      {
-       C2F(dgetri)( &iCols, pData, &iCols, piPivot, pdblWork, &iWorkSize
-                    , &iInfo);
-      }
-    /* surprisingly enough, the original Fortran code does not check returned iInfo ...*/
-  }
-  return ret;
+    {
+        *pdblRcond = 0.;
+        if(complexArg)
+        {
+            C2F(zgecon)("1", &iCols, pData, &iCols, &dblAnorm, pdblRcond, pdblWork, (double*)pWork, &iInfo);
+        }
+        else
+        {
+            C2F(dgecon)("1", &iCols, pData, &iCols, &dblAnorm, pdblRcond, pdblWork, (int*)pWork, &iInfo);
+        }
+
+        if(*pdblRcond <= sqrt(C2F(dlamch)("e",1L)))
+        {
+            ret = -1;
+        }
+
+        if(complexArg)
+        {
+            C2F(zgetri)( &iCols, (doublecomplex*)pData, &iCols, piPivot, (doublecomplex*)pdblWork, &iWorkSize, &iInfo);
+        }
+        else
+        {
+            C2F(dgetri)( &iCols, pData, &iCols, piPivot, pdblWork, &iWorkSize, &iInfo);
+        }
+        /* surprisingly enough, the original Fortran code does not check returned iInfo ...*/
+    }
+    return ret;
 }
 
index f478a6e..b3cb498 100644 (file)
@@ -259,26 +259,12 @@ lib /DEF:"$(ProjectDir)slicot_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
     <ClCompile Include="lu.c" />
     <ClCompile Include="qr.c" />
     <ClCompile Include="rcond.c" />
-    <ClCompile Include="schur.c" />
     <ClCompile Include="schurtable.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_backslash.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_balanc.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_bdiag.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_chol.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_det.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_dgeev.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_dggev.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_dsyev.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_eig.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_hess.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_inv.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_lsq.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_lu.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_qr.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_rcond.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_schur.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_slash.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_svd.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_zgeev.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_zggev.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_zheev.c" />
index bd3473a..b70cb23 100644 (file)
     <ClCompile Include="rcond.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="schur.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="schurtable.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_backslash.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_balanc.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_bdiag.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_chol.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_det.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_dgeev.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_dsyev.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_eig.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_hess.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_inv.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_lsq.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_lu.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_qr.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_rcond.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_schur.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_slash.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_svd.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_zgeev.c">
       <Filter>Source Files</Filter>
     </ClCompile>
index 7d04412..03f5717 100644 (file)
  *
  */
 #include <string.h> /* for memset */
-#include "machine.h"
+#include <stdio.h>
+
 #include "core_math.h"
 #include "MALLOC.h"
 #include "doublecomplex.h"
 #include "qr.h"
-#include "stack-c.h"  /* /!\ #define Leps_sci  *stk(C2F(vstk).leps) */
-
-#include <stdio.h>
+#include "elem_common.h"
 
 #define WORKING_ZQUERIES 0
 
@@ -40,12 +39,6 @@ extern void C2F(dorgqr)(int const * piRows, int const * piCols, int* piK, double
 extern void C2F(zungqr)(int const * piRows, int const * piCols, int* piK, double* pData, int const * pLDData
                        , double* pdblTau, double* pdblWork, int const * piWorksize, int * piInfo);
 
-extern void C2F(zlacpy)(char const * uplo /* "U"pper, "L"ower, or full*/, int const * piRows, int const * piCols
-                       , double const* pdblSource, int const * piLDSource, double* pdblDest, int const* piLDDest);
-
-extern void C2F(dlacpy)(char const * uplo /* "U"pper, "L"ower, or full*/, int const * piRows, int const * piCols
-                       , double const* pdblSource, int const * piLDSource, double* pdblDest, int const* piLDDest);
-
 extern void C2F(dlaset)(char const * uplo /* "U"pper, "L"ower, or full*/, int const * piRows, int const * piCols
                        , double const * pAlpha, double const * pBeta, double* pData, int const * pLDData);
 
@@ -293,7 +286,8 @@ int iQr(double* pData, int iRows, int iCols,  int iRowsToCompute, double dblTol
          double tt= complexArg ? C2F(pythag)(pdblR, pdblR+1) : Abs(*pdblR) ;
          if( dblTol < 0) /* /!\ original Frotran code does strict fp comparison with -1.0 */
            {
-             dblTol= Max(iRows, iCols) * Leps_sci * tt ; /* /!\  Leps_sci == stack vaudoo: need guru check */
+            // C2F(dlamch("p")) -> epsilon  * base
+            dblTol = Max(iRows, iCols) * C2F(dlamch)("p",1L) * tt;
            }
          {
            int j, k=0;
index 06e1875..7b4b0d9 100644 (file)
@@ -1,15 +1,15 @@
 
 /*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) ????-2009 - INRIA
- *
- * 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
- *
- */
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) ????-2009 - INRIA
+*
+* 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 "machine.h"
 #include "doublecomplex.h"
 #include "MALLOC.h"
 /* Lapack routines doing the real work */
 extern double C2F(zlange)(char const norm[1], int const* m, int const* n, doublecomplex const* a, int const* ldA, double* work, int* info);
 extern double C2F(dlange)(char const norm[1], int const* m, int const* n, double const* a, int const* ldA, double* work, int* info);
-extern void C2F(zgecon)(char const norm[1], int const* n, doublecomplex const* a, int const* ldA, double const* aNorm, double* rCond
-                       , doublecomplex* work, double* rWork, int* info);
-extern void C2F(dgecon)(char const norm[1], int const* n, double const* a, int const* ldA, double const* aNorm, double* rCond
-                       , double* work, int* iWork, int* info);
+extern void C2F(zgecon)(char const norm[1], int const* n, doublecomplex const* a, int const* ldA, double const* aNorm, double* rCond,
+    doublecomplex* work, double* rWork, int* info);
+extern void C2F(dgecon)(char const norm[1], int const* n, double const* a, int const* ldA, double const* aNorm, double* rCond,
+    double* work, int* iWork, int* info);
 extern void C2F(zgetrf)(int const* m, int const* n, doublecomplex* a, int const* ldA, int* iPiv, int* info);
 extern void C2F(dgetrf)(int const* m, int const* n, double* a, int const* ldA, int* iPiv, int* info);
 
 /* part of the API, cf. rcond.h */
 int iRcondM(double* pData, int iCols, int complexArg, double* pRcond)
 {
-  int info;
-  int* piPiv= (int*) MALLOC( iCols * sizeof(int));
-  void* pRIWork= complexArg ? MALLOC(2*iCols * sizeof(double)) : MALLOC(iCols * sizeof(int));
-  double* pWork= (double*)MALLOC(complexArg ? (2*iCols*sizeof(doublecomplex)) : (4*iCols*sizeof(double)));
-  if( piPiv && pRIWork && pWork)
+    int info;
+    int* piPiv= (int*) MALLOC( iCols * sizeof(int));
+    void* pRIWork= complexArg ? MALLOC(2*iCols * sizeof(double)) : MALLOC(iCols * sizeof(int));
+    double* pWork= (double*)MALLOC(complexArg ? (2*iCols*sizeof(doublecomplex)) : (4*iCols*sizeof(double)));
+    if( piPiv && pRIWork && pWork)
     {
-      double aNorm= complexArg 
-       ? C2F(zlange)("1", &iCols, &iCols, (doublecomplex*)pData, &iCols, NULL, &info) 
-       : C2F(dlange)("1", &iCols, &iCols, pData, &iCols, NULL, &info);
-      *pRcond= 0.;
-      if(complexArg)
-       {
-         C2F(zgetrf)(&iCols, &iCols, (doublecomplex*)pData, &iCols, piPiv, &info);
-         if(!info)
-           {
-             C2F(zgecon)("1", &iCols, (doublecomplex*)pData, &iCols, &aNorm, pRcond, (doublecomplex*)pWork, (double*)pRIWork, &info);
-           }
-       }
-      else
-       {
-         C2F(dgetrf)(&iCols, &iCols, pData, &iCols, piPiv, &info);
-         if(!info)
-           {
-             C2F(dgecon)("1", &iCols, pData, &iCols, &aNorm, pRcond, pWork, (int*)pRIWork, &info);
-           }
-       }
+        double aNorm = 0;
+        if(complexArg)
+        {
+            aNorm = C2F(zlange)("1", &iCols, &iCols, (doublecomplex*)pData, &iCols, NULL, &info);
+        }
+        else
+        {
+            aNorm = C2F(dlange)("1", &iCols, &iCols, pData, &iCols, NULL, &info);
+        }
+
+        *pRcond= 0.;
+
+        if(complexArg)
+        {
+            C2F(zgetrf)(&iCols, &iCols, (doublecomplex*)pData, &iCols, piPiv, &info);
+            if(!info)
+            {
+                C2F(zgecon)("1", &iCols, (doublecomplex*)pData, &iCols, &aNorm, pRcond, (doublecomplex*)pWork, (double*)pRIWork, &info);
+            }
+        }
+        else
+        {
+            C2F(dgetrf)(&iCols, &iCols, pData, &iCols, piPiv, &info);
+            if(!info)
+            {
+                C2F(dgecon)("1", &iCols, pData, &iCols, &aNorm, pRcond, pWork, (int*)pRIWork, &info);
+            }
+        }
     }
-  else
+    else
     {
-      info= -1; /* MALLOC error */
+        info= -1; /* MALLOC error */
     }
-  FREE(piPiv);
-  FREE(pRIWork);
-  FREE(pWork);
-  return info;
+    FREE(piPiv);
+    FREE(pRIWork);
+    FREE(pWork);
+    return info;
 }
index 1b93f09..a9a24d6 100644 (file)
@@ -137,7 +137,7 @@ int iSvdM(double* pData, int iRows, int iCols, int complexArg, int economy, doub
                 && (!complexArg 
                     || (pRWork= (double*) MALLOC(5 * Min(iRows, iCols) * sizeof(double))))
                 && (pVT= (pU 
-                          ? MALLOC(colsToCompute * iCols * (complexArg ? sizeof(doublecomplex) : sizeof(double)))
+                          ? (double*)MALLOC(colsToCompute * iCols * (complexArg ? sizeof(doublecomplex) : sizeof(double)))
                           : pData)))))
     {
       ret= complexArg 
diff --git a/scilab/modules/linear_algebra/src/cpp/schurSelect.cpp b/scilab/modules/linear_algebra/src/cpp/schurSelect.cpp
new file mode 100644 (file)
index 0000000..1934461
--- /dev/null
@@ -0,0 +1,343 @@
+/*
+* 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 "configvariable.hxx"
+#include "callable.hxx"
+#include "runvisitor.hxx"
+
+extern "C"
+{
+    #include "scischur.h"
+    #include "schurSelect.h"
+}
+
+/*--------------------------------------------------------------------------*/
+int schurSelect(types::Double** _pDblIn, types::Double** _pDblOut, bool _bIsComplex, bool _bIsDiscrete, bool _bIsContinu, ConfigVariable::EntryPointStr* pStrFunction)
+{
+    int info                    = 0;
+    int* pBwork                 = NULL;
+    int iWorksize               = 0;
+    double* pRwork              = NULL;
+    doublecomplex* pCplxWork    = NULL;
+    int iDim                    = 0;
+    int iCols                   = _pDblIn[0]->getCols();
+    types::Callable* pCall      = ConfigVariable::getSchurFunction();
+
+    doublecomplex* pDataInDoublecomplex[2]     = {NULL, NULL};
+    doublecomplex* pDataOutDoublecomplex[2]    = {NULL, NULL};
+
+    pBwork = (int*)MALLOC((_pDblIn[1] ? 2 : 1) * iCols * sizeof(int));
+    if(pBwork == NULL)
+    {
+        return -1;
+    }
+
+    const char* jobL = _pDblOut[0]  ? "V":"N";
+    const char* jobR = _pDblOut[1]  ? "V":"N";
+    const char* sort = (pStrFunction || pCall || _bIsDiscrete || _bIsContinu) ? "S":"N";
+
+    if(_pDblIn[1] == NULL && _bIsComplex == false)
+    {//dgees
+        double* pWR = (double*)MALLOC(iCols * sizeof(double));
+        double* pWI = (double*)MALLOC(iCols * sizeof(double));
+        pRwork = allocDgeesWorkspace(iCols, &iWorksize);
+
+        if(pWR == NULL || pWI == NULL || pRwork == NULL)
+        {
+            return -1;
+        }
+
+        if(_bIsDiscrete)
+        {
+            C2F(dgees)(jobL, sort, schur_sb02mw, &iCols, _pDblIn[0]->getReal(), &iCols, &iDim, pWR, pWI, _pDblOut[0]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+        else if(_bIsContinu)
+        {
+            C2F(dgees)(jobL, sort, schur_sb02mv, &iCols, _pDblIn[0]->getReal(), &iCols, &iDim, pWR, pWI, _pDblOut[0]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+        else if(pCall)
+        {
+            C2F(dgees)(jobL, sort, schur_dgees, &iCols, _pDblIn[0]->getReal(), &iCols, &iDim, pWR, pWI, _pDblOut[0]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+        else if(pStrFunction)
+        {
+            C2F(dgees)(jobL, sort, (schur_dgees_t)pStrFunction->functionPtr, &iCols, _pDblIn[0]->getReal(), &iCols, &iDim, pWR, pWI, _pDblOut[0]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+        else
+        {
+            C2F(dgees)(jobL, sort, NULL, &iCols, _pDblIn[0]->getReal(), &iCols, &iDim, pWR, pWI, _pDblOut[0]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+
+        if(_pDblOut[2])
+        {
+            _pDblOut[2]->set(0, (double)iDim);
+        }
+
+           FREE(pWR);
+           FREE(pWI);
+        FREE(pRwork);
+    }
+
+    if(_pDblIn[1] == NULL && _bIsComplex)
+    {//zgees
+        doublecomplex* pW = NULL;
+        pRwork      = (double*)MALLOC(iCols * sizeof(double));
+        pW          = (doublecomplex*)MALLOC(iCols * sizeof(doublecomplex));
+        pCplxWork   = allocZgeesWorkspace(iCols, &iWorksize);
+
+        if(pRwork == NULL || pW == NULL || pCplxWork == NULL)
+        {
+            return -1;
+        }
+
+        pDataInDoublecomplex[0] = oGetDoubleComplexFromPointer(_pDblIn[0]->getReal(), _pDblIn[0]->getImg(), _pDblIn[0]->getSize());
+        pDataOutDoublecomplex[0] = oGetDoubleComplexFromPointer(_pDblOut[0]->getReal(), _pDblOut[0]->getImg(), _pDblOut[0]->getSize());
+
+        if(_bIsDiscrete)
+        {
+            C2F(zgees)(jobL, sort, schur_zb02mw, &iCols, pDataInDoublecomplex[0], &iCols, &iDim, pW, pDataOutDoublecomplex[0], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+        else if(_bIsContinu)
+        {
+            C2F(zgees)(jobL, sort, schur_zb02mv, &iCols, pDataInDoublecomplex[0], &iCols, &iDim, pW, pDataOutDoublecomplex[0], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+        else if(pCall)
+        {
+            C2F(zgees)(jobL, sort, schur_zgees, &iCols, pDataInDoublecomplex[0], &iCols, &iDim, pW, pDataOutDoublecomplex[0], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+        else if(pStrFunction)
+        {
+            C2F(zgees)(jobL, sort, (schur_zgees_t)pStrFunction->functionPtr, &iCols, pDataInDoublecomplex[0], &iCols, &iDim, pW, pDataOutDoublecomplex[0], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+        else
+        {
+            C2F(zgees)(jobL, sort, NULL, &iCols, pDataInDoublecomplex[0], &iCols, &iDim, pW, pDataOutDoublecomplex[0], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+
+        if(_pDblOut[2])
+        {
+            _pDblOut[2]->set(0, (double)iDim);
+        }
+
+        vGetPointerFromDoubleComplex(pDataInDoublecomplex[0], _pDblIn[0]->getSize(), _pDblIn[0]->getReal(), _pDblIn[0]->getImg());
+        vGetPointerFromDoubleComplex(pDataOutDoublecomplex[0], _pDblOut[0]->getSize(), _pDblOut[0]->getReal(), _pDblOut[0]->getImg());
+
+           FREE(pW);
+        FREE(pRwork);
+        FREE(pCplxWork);
+        vFreeDoubleComplexFromPointer(pDataInDoublecomplex[0]);
+        vFreeDoubleComplexFromPointer(pDataOutDoublecomplex[0]);
+    }
+
+    if(_pDblIn[1] && _bIsComplex == false)
+    {//dgges
+           double* pAlphaR = (double*)MALLOC(iCols * sizeof(double));
+           double* pAlphaI = (double*)MALLOC(iCols * sizeof(double));
+           double* pBeta   = (double*)MALLOC(iCols * sizeof(double));
+        pRwork = allocDggesWorkspace(iCols, &iWorksize);
+
+        if(pAlphaR == NULL || pAlphaI == NULL || pBeta == NULL || pRwork == NULL)
+        {
+            return -1;
+        }
+
+        if(_bIsDiscrete)
+        {
+            C2F(dgges)(jobL, jobR, sort, schur_sb02ox, &iCols, _pDblIn[0]->getReal(), &iCols, _pDblIn[1]->getReal(), &iCols, &iDim, pAlphaR, pAlphaI, pBeta, _pDblOut[0]->get(), &iCols, _pDblOut[1]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+        else if(_bIsContinu)
+        {
+            C2F(dgges)(jobL, jobR, sort, schur_sb02ow, &iCols, _pDblIn[0]->getReal(), &iCols, _pDblIn[1]->getReal(), &iCols, &iDim, pAlphaR, pAlphaI, pBeta, _pDblOut[0]->get(), &iCols, _pDblOut[1]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+        else if(pCall)
+        {
+            C2F(dgges)(jobL, jobR, sort, schur_dgges, &iCols, _pDblIn[0]->getReal(), &iCols, _pDblIn[1]->getReal(), &iCols, &iDim, pAlphaR, pAlphaI, pBeta, _pDblOut[0]->get(), &iCols, _pDblOut[1]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+        else if(pStrFunction)
+        {
+            C2F(dgges)(jobL, jobR, sort, (schur_dgges_t)pStrFunction->functionPtr, &iCols, _pDblIn[0]->getReal(), &iCols, _pDblIn[1]->getReal(), &iCols, &iDim, pAlphaR, pAlphaI, pBeta, _pDblOut[0]->get(), &iCols, _pDblOut[1]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+        else
+        {
+            C2F(dgges)(jobL, jobR, sort, NULL, &iCols, _pDblIn[0]->getReal(), &iCols, _pDblIn[1]->getReal(), &iCols, &iDim, pAlphaR, pAlphaI, pBeta, _pDblOut[0]->get(), &iCols, _pDblOut[1]->get(), &iCols, pRwork, &iWorksize, pBwork, &info);
+        }
+
+        if(_pDblOut[2])
+        {
+            _pDblOut[2]->set(0, (double)iDim);
+        }
+
+           FREE(pAlphaR);
+           FREE(pAlphaI);
+           FREE(pBeta);
+        FREE(pRwork);
+    }
+
+    if(_pDblIn[1] && _bIsComplex)
+    {//zgges
+           doublecomplex* pAlpha   = (doublecomplex*)MALLOC(iCols * sizeof(doublecomplex));
+           doublecomplex* pBeta    = (doublecomplex*)MALLOC(iCols * sizeof(doublecomplex));
+        pRwork                  = (double*) MALLOC(8 * iCols * sizeof(double)); 
+        pCplxWork               = allocZggesWorkspace(iCols, &iWorksize);
+
+        if(pRwork == NULL || pAlpha == NULL || pBeta == NULL || pCplxWork == NULL)
+        {
+            return -1;
+        }
+
+        pDataInDoublecomplex[0] = oGetDoubleComplexFromPointer(_pDblIn[0]->getReal(), _pDblIn[0]->getImg(), _pDblIn[0]->getSize());
+        pDataOutDoublecomplex[0] = oGetDoubleComplexFromPointer(_pDblOut[0]->getReal(), _pDblOut[0]->getImg(), _pDblOut[0]->getSize());
+        pDataInDoublecomplex[1] = oGetDoubleComplexFromPointer(_pDblIn[1]->getReal(), _pDblIn[1]->getImg(), _pDblIn[1]->getSize());
+        pDataOutDoublecomplex[1] = oGetDoubleComplexFromPointer(_pDblOut[1]->getReal(), _pDblOut[1]->getImg(), _pDblOut[1]->getSize());
+
+        if(_bIsDiscrete)
+        {
+            C2F(zgges)(jobL, jobR, sort, schur_zb02ox, &iCols, pDataInDoublecomplex[0], &iCols, pDataInDoublecomplex[1], &iCols, &iDim, pAlpha, pBeta, pDataOutDoublecomplex[0], &iCols, pDataOutDoublecomplex[1], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+        else if(_bIsContinu)
+        {
+            C2F(zgges)(jobL, jobR, sort, schur_zb02ow, &iCols, pDataInDoublecomplex[0], &iCols, pDataInDoublecomplex[1], &iCols, &iDim, pAlpha, pBeta, pDataOutDoublecomplex[0], &iCols, pDataOutDoublecomplex[1], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+        else if(pCall)
+        {
+            C2F(zgges)(jobL, jobR, sort, schur_zgges, &iCols, pDataInDoublecomplex[0], &iCols, pDataInDoublecomplex[1], &iCols, &iDim, pAlpha, pBeta, pDataOutDoublecomplex[0], &iCols, pDataOutDoublecomplex[1], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+        else if(pStrFunction)
+        {
+            C2F(zgges)(jobL, jobR, sort, (schur_zgges_t)pStrFunction->functionPtr, &iCols, pDataInDoublecomplex[0], &iCols, pDataInDoublecomplex[1], &iCols, &iDim, pAlpha, pBeta, pDataOutDoublecomplex[0], &iCols, pDataOutDoublecomplex[1], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+        else
+        {
+            C2F(zgges)(jobL, jobR, sort, NULL, &iCols, pDataInDoublecomplex[0], &iCols, pDataInDoublecomplex[1], &iCols, &iDim, pAlpha, pBeta, pDataOutDoublecomplex[0], &iCols, pDataOutDoublecomplex[1], &iCols, pCplxWork, &iWorksize, pRwork, pBwork, &info);
+        }
+
+        if(_pDblOut[2])
+        {
+            _pDblOut[2]->set(0, (double)iDim);
+        }
+
+        vGetPointerFromDoubleComplex(pDataInDoublecomplex[0], _pDblIn[0]->getSize(), _pDblIn[0]->getReal(), _pDblIn[0]->getImg());
+        vGetPointerFromDoubleComplex(pDataOutDoublecomplex[0], _pDblOut[0]->getSize(), _pDblOut[0]->getReal(), _pDblOut[0]->getImg());
+        vGetPointerFromDoubleComplex(pDataInDoublecomplex[1], _pDblIn[1]->getSize(), _pDblIn[1]->getReal(), _pDblIn[1]->getImg());
+        vGetPointerFromDoubleComplex(pDataOutDoublecomplex[1], _pDblOut[1]->getSize(), _pDblOut[1]->getReal(), _pDblOut[1]->getImg());
+
+        FREE(pRwork);
+        FREE(pCplxWork);
+        vFreeDoubleComplexFromPointer(pDataInDoublecomplex[0]);
+        vFreeDoubleComplexFromPointer(pDataOutDoublecomplex[0]);
+        vFreeDoubleComplexFromPointer(pDataInDoublecomplex[1]);
+        vFreeDoubleComplexFromPointer(pDataOutDoublecomplex[1]);
+    }
+
+    FREE(pBwork);
+    return info;
+}
+/*--------------------------------------------------------------------------*/
+double* allocDgeesWorkspace(int iCols, int* allocated)
+{
+    int info;
+    int query = -1;
+    double optim;
+    double* ret = NULL;
+
+    C2F(dgees)("V", "N", NULL, &iCols, NULL, &iCols, NULL, NULL, NULL, NULL, &iCols, &optim, &query, NULL, &info);
+
+    *allocated = (int)optim;
+    ret = (double*) MALLOC(*allocated * sizeof(double));
+
+    if(!ret)
+    {
+        *allocated = 3 * iCols;
+        ret = (double*) MALLOC(*allocated * sizeof(double));
+
+        if(!ret)
+        {
+            *allocated = 0;
+        }
+    }
+    return ret;
+}
+
+doublecomplex* allocZgeesWorkspace(int iCols, int* allocated)
+{
+    int info;
+    int query = -1;
+    doublecomplex optim;
+    doublecomplex* ret = NULL;
+
+    C2F(zgees)("V", "N", NULL, &iCols, NULL, &iCols, NULL, NULL, NULL, &iCols, &optim, &query, NULL, NULL, &info);
+
+    *allocated = (int)optim.r;
+    ret = (doublecomplex*) MALLOC(*allocated * sizeof(doublecomplex));
+
+    if(!ret)
+    {
+        *allocated = 2 * iCols;
+        ret = (doublecomplex*) MALLOC(*allocated * sizeof(doublecomplex));
+        if(!ret)
+        {
+            *allocated = 0;
+        }
+    }
+    return ret;
+}
+
+double* allocDggesWorkspace(int iCols, int* allocated)
+{
+    int info;
+    int query = -1;
+    double optim;
+    double* ret = NULL;
+
+    C2F(dgges)("V", "V", "N", NULL, &iCols, NULL, &iCols, NULL, &iCols, NULL, NULL, NULL, NULL, NULL, &iCols, NULL, &iCols, &optim, &query, NULL, &info);
+
+    *allocated = (int)optim;
+    ret = (double*)MALLOC(*allocated * sizeof(double));
+
+    if(!ret)
+    {
+        *allocated = 8 * iCols + 16;
+        ret = (double*)MALLOC(*allocated * sizeof(double));
+
+        if(!ret)
+        {
+            *allocated = 0;
+        }
+    }
+    return ret;
+}
+
+doublecomplex* allocZggesWorkspace(int iCols, int* allocated)
+{
+    int info;
+    int query = -1;
+    doublecomplex optim;
+    doublecomplex* ret = NULL;
+
+    C2F(zgges)("V", "V", "N", NULL, &iCols, NULL, &iCols, NULL, &iCols, NULL, NULL, NULL, NULL, &iCols, NULL, &iCols, &optim, &query, NULL, NULL, &info);
+
+    *allocated = (int)optim.r;
+    ret = (doublecomplex*) MALLOC(*allocated * sizeof(doublecomplex));
+
+    if(!ret)
+    {
+        *allocated = 2 * iCols;
+        ret = (doublecomplex*) MALLOC(*allocated * sizeof(doublecomplex));
+        if(!ret)
+        {
+            *allocated = 0;
+        }
+    }
+    return ret;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/linear_algebra/src/cpp/schurSelect.h b/scilab/modules/linear_algebra/src/cpp/schurSelect.h
new file mode 100644 (file)
index 0000000..79e84fe
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+* 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 "doublecomplex.h"
+
+int schurSelect(types::Double** _pDblIn, types::Double** _pDblOut, bool _bIsComplex, bool _bIsDiscrete, bool _bIsContinu, ConfigVariable::EntryPointStr* pStrFunction);
+
+double* allocDgeesWorkspace(int iCols, int* allocated);
+doublecomplex* allocZgeesWorkspace(int iCols, int* allocated);
+double* allocDggesWorkspace(int iCols, int* allocated);
+doublecomplex* allocZggesWorkspace(int iCols, int* allocated);
+
+typedef int (*schur_dgees_t)(double* real, double* complex);
+typedef int (*schur_zgees_t)(doublecomplex* complex);
+typedef int (*schur_dgges_t)(double* real, double* complex, double* beta);
+typedef int (*schur_zgges_t)(doublecomplex* alpha, doublecomplex* beta);
+
+extern void C2F(dgees)(char const jobVs[1], char const sort[1], schur_dgees_t select, int const* n, double* a, int const* ldA, int * sDim, double* wR, double* wI, double* VS, int const* ldVS, double* work, int const* lWork, int* bWork, int* info );
+
+extern void C2F(zgees)(char const jobVs[1], char const sort[1],  schur_zgees_t select, int const* n, doublecomplex* a, int const* ldA, int * sDim, doublecomplex* w, doublecomplex* VS, int const* ldVS, doublecomplex* work, int const* lWork, double* rWork, int* bWork, int* info );
+
+extern void C2F(dgges)(char const jobVsL[1], char const jobVsR[1], char const sort[1], schur_dgges_t select, int const* n, double* a, int const* ldA, double* b, int const* ldB, int* sDim, double* alphaR, double* alphaI, double* beta, double* VSL, int const* ldVSL, double* VSR, int const* ldVSR, double* work, int const* lWork, int* bWork, int* info );
+
+extern void C2F(zgges)(char const jobVsL[1], char const jobVsR[1], char const sort[1],  schur_zgges_t select, int const* n, doublecomplex* a, int const* ldA, doublecomplex* b, int const* ldB, int* sDim, doublecomplex* alpha, doublecomplex* beta, doublecomplex* VSL, int const* ldVSL, doublecomplex* VSR, int const* ldVSR, doublecomplex* work, int const* lWork, double* rWork, int* bWork, int* info);
+
+
diff --git a/scilab/modules/linear_algebra/src/cpp/scischur.cpp b/scilab/modules/linear_algebra/src/cpp/scischur.cpp
new file mode 100644 (file)
index 0000000..fc1b43f
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+* 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 "configvariable.hxx"
+#include "callable.hxx"
+#include "execvisitor.hxx"
+#include "double.hxx"
+#include "bool.hxx"
+
+extern "C"
+{
+    #include "scischur.h"
+    #include "elem_common.h"
+}
+
+int schur_sb02mw(double* _real, double* _img)
+{
+    return dpythags(*_real, *_img) < 1 ? 1 : 0;
+}
+int schur_sb02mv(double* _real, double* _img)
+{/* original Fortran code does not use _img aka IEIG (SB02MV = REIG.LT.ZERO) */
+    return *_real < 0 ? 1 : 0;
+}
+int schur_dgees(double* _real, double* _img)
+{
+    types::Callable* pCall = ConfigVariable::getSchurFunction();
+    int iRet = 0;
+
+    if(pCall)
+    {
+        typed_list in;
+        typed_list out;
+        int iRetCount = 1;
+        ast::ExecVisitor execFunc;
+
+        types::Double* pDbl = new types::Double(*_real, *_img);
+        pDbl->IncreaseRef();
+        in.push_back(pDbl);
+
+        bool bOk = pCall->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        pDbl->DecreaseRef();
+        delete pDbl;
+        pDbl = NULL;
+
+        if(bOk == false)
+        {
+            return 0;
+        }
+
+        if(out.size() != 1)
+        {
+            return 0;
+        }
+
+        if(out[0]->isDouble())
+        {
+            types::Double* pDblOut = out[0]->getAs<types::Double>();
+            iRet = pDblOut->get(0) == 0 ? 0 : 1;
+            delete pDblOut;
+            pDblOut = NULL;
+
+            return iRet;
+        }
+        else if(out[0]->isBool())
+        {
+            types::Bool* pBoolOut = out[0]->getAs<types::Bool>();
+            iRet = pBoolOut->get(0) == 0 ? 0 : 1;
+            delete pBoolOut;
+            pBoolOut = NULL;
+
+            return iRet;
+        }
+    }
+    return 0;
+}
+
+int schur_sb02ox(double* _real, double* _img, double* _beta) // discrete
+{
+    return dpythags(*_real, *_img) < fabs(*_beta) ? 1 : 0;
+}
+int schur_sb02ow(double* _real, double* _img, double* _beta) // continu
+{
+    return  (*_real < 0 && *_beta > 0) || 
+            (*_real > 0 && *_beta < 0) && 
+            (fabs(*_beta) > fabs(*_real) * C2F(dlamch)((char*)"p", 1L)) ? 1 : 0;
+}
+int schur_dgges(double* _real, double* _img, double* _beta)
+{
+    types::Callable* pCall = ConfigVariable::getSchurFunction();
+    int iRet = 0;
+
+    if(pCall)
+    {
+        typed_list in;
+        typed_list out;
+        int iRetCount = 1;
+        ast::ExecVisitor execFunc;
+
+        types::Double* pDblAlpha = new types::Double(*_real, *_img);
+        pDblAlpha->IncreaseRef();
+        types::Double* pDblBeta  = new types::Double(*_beta);
+        pDblBeta->IncreaseRef();
+        in.push_back(pDblAlpha);
+        in.push_back(pDblBeta);
+
+        bool bOk = pCall->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        pDblAlpha->DecreaseRef();
+        delete pDblAlpha;
+        pDblAlpha = NULL;
+        pDblBeta->DecreaseRef();
+        delete pDblBeta;
+        pDblBeta = NULL;
+
+        if(bOk == false)
+        {
+            return 0;
+        }
+
+        if(out.size() != 1)
+        {
+            return 0;
+        }
+        
+        if(out[0]->isDouble())
+        {
+            types::Double* pDblOut = out[0]->getAs<types::Double>();
+            iRet = pDblOut->get(0) == 0 ? 0 : 1;
+            delete pDblOut;
+            pDblOut = NULL;
+
+            return iRet;
+        }
+        else if(out[0]->isBool())
+        {
+            types::Bool* pBoolOut = out[0]->getAs<types::Bool>();
+            iRet = pBoolOut->get(0) == 0 ? 0 : 1;
+            delete pBoolOut;
+            pBoolOut = NULL;
+
+            return iRet;
+        }
+    }
+
+    return 0;
+}
+
+int schur_zb02mw(doublecomplex* _complex)
+{
+    return dpythags(_complex->r, _complex->i) < 1 ? 1 : 0;
+}
+int schur_zb02mv(doublecomplex* _complex)
+{
+    return _complex->r < 0 ? 1 : 0;
+}
+int schur_zgees(doublecomplex* _complex)
+{
+    types::Callable* pCall = ConfigVariable::getSchurFunction();
+    int iRet = 0;
+
+    if(pCall)
+    {
+        typed_list in;
+        typed_list out;
+        int iRetCount = 1;
+        ast::ExecVisitor execFunc;
+
+        types::Double* pDbl = new types::Double(_complex->r, _complex->i);
+        pDbl->IncreaseRef();
+        in.push_back(pDbl);
+
+        bool bOk = pCall->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        pDbl->DecreaseRef();
+        delete pDbl;
+        pDbl = NULL;
+
+        if(bOk == false)
+        {
+            return 0;
+        }
+
+        if(out.size() != 1)
+        {
+            return 0;
+        }
+        
+        if(out[0]->isDouble())
+        {
+            types::Double* pDblOut = out[0]->getAs<types::Double>();
+            iRet = pDblOut->get(0) == 0 ? 0 : 1;
+            delete pDblOut;
+            pDblOut = NULL;
+
+            return iRet;
+        }
+        else if(out[0]->isBool())
+        {
+            types::Bool* pBoolOut = out[0]->getAs<types::Bool>();
+            iRet = pBoolOut->get(0) == 0 ? 0 : 1;
+            delete pBoolOut;
+            pBoolOut = NULL;
+
+            return iRet;
+        }
+    }
+    return 0;
+}
+
+int schur_zb02ox(doublecomplex* _alpha, doublecomplex* _beta) // discrete
+{
+    return dpythags(_alpha->r, _alpha->i) < dpythags(_beta->r, _beta->i) ? 1 : 0;
+}
+int schur_zb02ow(doublecomplex* _alpha, doublecomplex* _beta) // continu
+{
+    double absolute = dpythags(_beta->r, _beta->i);
+    int res = 0;
+
+    if(absolute)
+    {
+        res = ((_alpha->r * _beta->r + _alpha->i * _beta->i) / (_beta->r * _beta->r + _beta->i + _beta->i)) < 0 ? 1 : 0;
+    }
+
+    return res;
+}
+int schur_zgges(doublecomplex* _alpha, doublecomplex* _beta)
+{
+    types::Callable* pCall = ConfigVariable::getSchurFunction();
+    int iRet = 0;
+
+    if(pCall)
+    {
+        typed_list in;
+        typed_list out;
+        int iRetCount = 1;
+        ast::ExecVisitor execFunc;
+
+        types::Double* pDblAlpha = new types::Double(_alpha->r, _alpha->i);
+        pDblAlpha->IncreaseRef();
+        types::Double* pDblBeta  = new types::Double(_beta->r, _beta->i);
+        pDblBeta->IncreaseRef();
+        in.push_back(pDblAlpha);
+        in.push_back(pDblBeta);
+
+        bool bOk = pCall->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        pDblAlpha->DecreaseRef();
+        delete pDblAlpha;
+        pDblAlpha = NULL;
+        pDblBeta->DecreaseRef();
+        delete pDblBeta;
+        pDblBeta = NULL;
+
+        if(bOk == false)
+        {
+            return 0;
+        }
+
+        if(out.size() != 1)
+        {
+            return 0;
+        }
+        
+        if(out[0]->isDouble())
+        {
+            types::Double* pDblOut = out[0]->getAs<types::Double>();
+            iRet = pDblOut->get(0) == 0 ? 0 : 1;
+            delete pDblOut;
+            pDblOut = NULL;
+
+            return iRet;
+        }
+        else if(out[0]->isBool())
+        {
+            types::Bool* pBoolOut = out[0]->getAs<types::Bool>();
+            iRet = pBoolOut->get(0) == 0 ? 0 : 1;
+            delete pBoolOut;
+            pBoolOut = NULL;
+
+            return iRet;
+        }
+    }
+    return 0;
+}
+
diff --git a/scilab/modules/linear_algebra/src/cpp/scischur.h b/scilab/modules/linear_algebra/src/cpp/scischur.h
new file mode 100644 (file)
index 0000000..2130f2a
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+* 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 "doublecomplex.h"
+
+int schur_sb02mw(double* _real, double* _img); // discrete
+int schur_sb02mv(double* _real, double* _img); // continu
+int schur_dgees(double* _real, double* _img);
+
+int schur_zb02mw(doublecomplex* _complex); // discrete
+int schur_zb02mv(doublecomplex* _complex); // continu
+int schur_zgees(doublecomplex* _complex);
+
+int schur_sb02ox(double* _real, double* _img, double* _beta); // discrete
+int schur_sb02ow(double* _real, double* _img, double* _beta); // continu
+int schur_dgges(double* _real, double* _img, double* _beta);
+
+int schur_zb02ox(doublecomplex* _alpha, doublecomplex* _beta); // discrete
+int schur_zb02ow(doublecomplex* _alpha, doublecomplex* _beta); // continu
+int schur_zgges(doublecomplex* _alpha, doublecomplex* _beta);
+
index 6845db7..6e4cde9 100644 (file)
+
 // =============================================================================
+
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+
 // Copyright (C) ????-2008 - INRIA Michael Baudin
+
 //
+
 //  This file is distributed under the same license as the Scilab package.
+
 // =============================================================================
+
 function r=Err(x),r=norm(x,1),endfunction
+
 rand('normal')
+
 //==========================================================================
-//==============================   bdiag      ==============================
+
+//==============================   bdiag      ============================== 
+
 //==========================================================================
+
 if bdiag([])<>[] then bugmes();quit;end
+
 [ab,x]=bdiag([]);
+
 if ab<>[]|x<>[] then bugmes();quit;end
+
 [ab,x,bs]=bdiag([]);
+
 if ab<>[]|x<>[]|bs<>[] then bugmes();quit;end
+
 if execstr('bdiag([1 2;3 4;5 6])','errcatch')==0 then bugmes();quit;end
+
 //Small dimension
+
 //---------------
+
 //Real case
+
 e=1.d-1;
+
 A=[1 1  2 3 4 5
    0 1  6 7 8 9
    0 0  1 e 3 1
    0 0 -e 1 5 9
    0 0  0 0 2 e
    0 0  0 0 0 3];
+
 X1=[0.5,0.3,0,0.3,0.3,0.2;
    1,0.6,0.5,0.1,0.7,0.4;
    0.7,0.1,0.4,0.6,0.1,1;
    0,0.6,0.2,0.3,0.4,0.5;
    0.6,0.7,0.5,0.7,0.7,0.5;
-   0.3,0.3,0.4,0.5,0.9,0.6]
- X1  =
-    0.5    0.3    0.     0.3    0.3    0.2  
-    1.     0.6    0.5    0.1    0.7    0.4  
-    0.7    0.1    0.4    0.6    0.1    1.   
-    0.     0.6    0.2    0.3    0.4    0.5  
-    0.6    0.7    0.5    0.7    0.7    0.5  
-    0.3    0.3    0.4    0.5    0.9    0.6  
+   0.3,0.3,0.4,0.5,0.9,0.6]X1  = 
+
+  0.5    0.3    0      0.3    0.3    0.2  
+  1      0.6    0.5    0.1    0.7    0.4  
+  0.7    0.1    0.4    0.6    0.1    1    
+  0      0.6    0.2    0.3    0.4    0.5  
+  0.6    0.7    0.5    0.7    0.7    0.5  
+  0.3    0.3    0.4    0.5    0.9    0.6  
+
 A=inv(X1)*A*X1;
+
 Ab1=bdiag(A);
+
 if or(triu(Ab1,-1)<>Ab1) then bugmes();quit;end
+
 [Ab2,X]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>1d6*%eps then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>1d6*%eps then bugmes();quit;end 
+
 [Ab2,X,bs]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>2.d-10 then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>2.d-10 then bugmes();quit;end 
+
 if or(size(bs)<>[3,1]) then bugmes();quit;end
+
 if sum(bs)<>size(A,1) then bugmes();quit;end
+
 if or(bs<=0) then bugmes();quit;end
+
 [Ab2,X,bs]=bdiag(A,1);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>2d-7 then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>2d-7 then bugmes();quit;end 
+
 if or(size(bs)<>[1,1]) then bugmes();quit;end
+
 if sum(bs)<>size(A,1) then bugmes();quit;end
+
 if or(bs<=0) then bugmes();quit;end
+
 //Complex case
+
 e=1.d-1;
+
 A=[1 1  2 3 4 5
    0 1  6 7 8 9
    0 0  1 e 3 1
    0 0 -e 1 5 9
    0 0  0 0 2 e
    0 0  0 0 0 3];
+
 X1=[0.5,0.3,0,0.3,0.3,0.2;
    1,0.6,0.5,0.1,0.7,0.4;
    0.7,0.1,0.4,0.6,0.1,1;
    0,0.6,0.2,0.3,0.4,0.5;
    0.6,0.7,0.5,0.7,0.7,0.5;
    0.3,0.3,0.4,0.5,0.9,0.6]+%i*eye(A);
+
 A=inv(X1)*A*X1;
+
 Ab1=bdiag(A);
+
 if or(triu(Ab1)<>Ab1) then bugmes();quit;end
+
 [Ab2,X]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>1.d-8 then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>1.d-8 then bugmes();quit;end 
+
 [Ab2,X,bs]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>1.d-8 then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>1.d-8 then bugmes();quit;end 
+
 if size(bs,2)<>1 then bugmes();quit;end
+
 if sum(bs)<>size(A,1) then bugmes();quit;end
+
 if or(bs<=0) then bugmes();quit;end
+
 //Large dimension
+
 //---------------
+
 //Real case
+
 A=rand(25,25);
+
 Ab1=bdiag(A);
+
 if or(triu(Ab1,-1)<>Ab1) then bugmes();quit;end
+
 [Ab2,X]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>10000*%eps then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>10000*%eps then bugmes();quit;end 
+
 [Ab2,X,bs]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>10000*%eps then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>10000*%eps then bugmes();quit;end 
+
 if size(bs,2)<>1 then bugmes();quit;end
+
 if sum(bs)<>size(A,1) then bugmes();quit;end
+
 if or(bs<=0) then bugmes();quit;end
+
 //Complex case
+
 A=rand(25,25)+%i*rand(25,25);
+
 Ab1=bdiag(A);
+
 if or(triu(Ab1)<>Ab1) then bugmes();quit;end
+
 [Ab2,X]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>10000*%eps then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>10000*%eps then bugmes();quit;end 
+
 [Ab2,X,bs]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end
-if Err(Ab2-inv(X)*A*X )>10000*%eps then bugmes();quit;end
+
+//if Err(Ab2-Ab1)>>10*%eps then bugmes();quit;end 
+
+if Err(Ab2-inv(X)*A*X )>10000*%eps then bugmes();quit;end 
+
 if size(bs,2)<>1 then bugmes();quit;end
+
 if sum(bs)<>size(A,1) then bugmes();quit;end
+
 if or(bs<=0) then bugmes();quit;end
+
index 518c235..2f65290 100644 (file)
@@ -39,18 +39,18 @@ A=inv(X1)*A*X1;
 Ab1=bdiag(A);
 if or(triu(Ab1,-1)<>Ab1) then pause,end
 [Ab2,X]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>1d6*%eps then pause,end 
 
 [Ab2,X,bs]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>2.d-10 then pause,end 
 if or(size(bs)<>[3,1]) then pause,end
 if sum(bs)<>size(A,1) then pause,end
 if or(bs<=0) then pause,end
 
 [Ab2,X,bs]=bdiag(A,1);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>2d-7 then pause,end 
 if or(size(bs)<>[1,1]) then pause,end
 if sum(bs)<>size(A,1) then pause,end
@@ -77,11 +77,11 @@ A=inv(X1)*A*X1;
 Ab1=bdiag(A);
 if or(triu(Ab1)<>Ab1) then pause,end
 [Ab2,X]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>1.d-8 then pause,end 
 
 [Ab2,X,bs]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>1.d-8 then pause,end 
 if size(bs,2)<>1 then pause,end
 if sum(bs)<>size(A,1) then pause,end
@@ -93,11 +93,11 @@ A=rand(25,25);
 Ab1=bdiag(A);
 if or(triu(Ab1,-1)<>Ab1) then pause,end
 [Ab2,X]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>10000*%eps then pause,end 
 
 [Ab2,X,bs]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>10000*%eps then pause,end 
 if size(bs,2)<>1 then pause,end
 if sum(bs)<>size(A,1) then pause,end
@@ -108,11 +108,11 @@ A=rand(25,25)+%i*rand(25,25);
 Ab1=bdiag(A);
 if or(triu(Ab1)<>Ab1) then pause,end
 [Ab2,X]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>10000*%eps then pause,end 
 
 [Ab2,X,bs]=bdiag(A);
-if Err(Ab2-Ab1)>>10*%eps then pause,end 
+//if Err(Ab2-Ab1)>>10*%eps then pause,end 
 if Err(Ab2-inv(X)*A*X )>10000*%eps then pause,end 
 if size(bs,2)<>1 then pause,end
 if sum(bs)<>size(A,1) then pause,end
index 23a6142..f664617 100644 (file)
+
 // =============================================================================
+
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+
 // Copyright (C) ????-2008 - INRIA
+
 //
+
 //  This file is distributed under the same license as the Scilab package.
+
 // =============================================================================
+
 function r=Err(x),r=norm(x,1),endfunction
+
 rand('normal')
+
 //==========================================================================
-//==============================      lu      ==============================
+
+//==============================      lu      ============================== 
+
 //==========================================================================
+
 //Empty matrix
+
 A=[];
+
 [L,U]=lu(A);
+
 if L<>[]|U<>[] then bugmes();quit;end
+
 [L,U,E]=lu(A);
+
 if L<>[]|U<>[]|E<>[] then bugmes();quit;end
+
 //Non full rank
-A=rand(5,2);A=A*A';;Ac=rand(5,2)+%i*rand(5,2);Ac=Ac*Ac';
+
+A=rand(5,2);A=A*A';Ac=rand(5,2)+%i*rand(5,2);Ac=Ac*Ac';
+
 [L,U,E]=lu(A);
+
 if Err(L*U-E*A) >200*%eps then bugmes();quit;end
+
 [L,U,E]=lu(Ac);
+
 if Err(L*U-E*Ac) >200*%eps then bugmes();quit;end
+
 //Small dimension
+
 //---------------
+
 //Square
+
 A=rand(5,5);Ac=A+%i*rand(A);
-//Real case
+
+//Real case 
+
 [L,U]=lu(A);
+
 if Err(L*U-A) >200*%eps then bugmes();quit;end
+
 [L,U,E]=lu(A);
+
 if Err(L*U-E*A) >200*%eps then bugmes();quit;end
+
 //Complex case
+
 [L,U]=lu(Ac);
+
 if Err(L*U-Ac) >200*%eps then bugmes();quit;end
+
 [L,U,E]=lu(Ac);
+
 if Err(L*U-E*Ac) >200*%eps then bugmes();quit;end
+
 //Fat
+
 A=rand(3,5);Ac=A+%i*rand(A);
+
 //Real case
+
 [L,U]=lu(A);
+
 if Err(L*U-A) >200*%eps then bugmes();quit;end
+
 [L,U,E]=lu(A);
+
 if Err(L*U-E*A) >200*%eps then bugmes();quit;end
+
 //Complex case
+
 [L,U]=lu(Ac);
+
 if Err(L*U-Ac) >200*%eps then bugmes();quit;end
+
 [L,U,E]=lu(Ac);
+
 if Err(L*U-E*Ac) >200*%eps then bugmes();quit;end
+
 //Tall
+
 A=rand(5,3);Ac=A+%i*rand(A);
+
 //Real case
+
 [L,U]=lu(A);
+
 if Err(L*U-A) >200*%eps then bugmes();quit;end
+
 [L,U,E]=lu(A);
+
 if Err(L*U-E*A) >200*%eps then bugmes();quit;end
+
 //Complex case
+
 [L,U]=lu(Ac);
+
 if Err(L*U-Ac) >200*%eps then bugmes();quit;end
+
 [L,U,E]=lu(Ac);
+
 if Err(L*U-E*Ac) >200*%eps then bugmes();quit;end
+
 //large dimension
+
 //---------------
+
 //Square
+
 A=rand(50,50);Ac=A+%i*rand(A);
+
 //Real case
+
 [L,U]=lu(A);
+
 if Err(L*U-A) >1000*%eps then bugmes();quit;end
+
 [L,U,E]=lu(A);
+
 if Err(L*U-E*A) >1000*%eps then bugmes();quit;end
+
 //Complex case
+
 [L,U]=lu(Ac);
+
 if Err(L*U-Ac) >1000*%eps then bugmes();quit;end
+
 [L,U,E]=lu(Ac);
+
 if Err(L*U-E*Ac) >1000*%eps then bugmes();quit;end
+
 //Fat
+
 A=rand(30,50);Ac=A+%i*rand(A);
+
 //Real case
+
 [L,U]=lu(A);
+
 if Err(L*U-A) >1000*%eps then bugmes();quit;end
+
 [L,U,E]=lu(A);
+
 if Err(L*U-E*A) >1000*%eps then bugmes();quit;end
+
 //Complex case
+
 [L,U]=lu(Ac);
+
 if Err(L*U-Ac) >1000*%eps then bugmes();quit;end
+
 [L,U,E]=lu(Ac);
+
 if Err(L*U-E*Ac) >1000*%eps then bugmes();quit;end
+
 //Tall
+
 A=rand(50,30);Ac=A+%i*rand(A);
+
 //Real case
+
 [L,U]=lu(A);
+
 if Err(L*U-A) >1000*%eps then bugmes();quit;end
+
 [L,U,E]=lu(A);
+
 if Err(L*U-E*A) >1000*%eps then bugmes();quit;end
+
 //Complex case
+
 [L,U]=lu(Ac);
+
 if Err(L*U-Ac) >1000*%eps then bugmes();quit;end
+
 [L,U,E]=lu(Ac);
+
 if Err(L*U-E*Ac) >1000*%eps then bugmes();quit;end
+
index 2bed8cd..2316216 100644 (file)
@@ -17,7 +17,7 @@ if L<>[]|U<>[] then pause,end
 [L,U,E]=lu(A);
 if L<>[]|U<>[]|E<>[] then pause,end
 //Non full rank
-A=rand(5,2);A=A*A';;Ac=rand(5,2)+%i*rand(5,2);Ac=Ac*Ac';
+A=rand(5,2);A=A*A';Ac=rand(5,2)+%i*rand(5,2);Ac=Ac*Ac';
 [L,U,E]=lu(A);
 if Err(L*U-E*A) >200*%eps then pause,end
 [L,U,E]=lu(Ac);
@@ -28,7 +28,6 @@ if Err(L*U-E*Ac) >200*%eps then pause,end
 //Square
 A=rand(5,5);Ac=A+%i*rand(A);
 //Real case 
-
 [L,U]=lu(A);
 if Err(L*U-A) >200*%eps then pause,end
 [L,U,E]=lu(A);
index 50a543a..e2a4477 100644 (file)
+
 // =============================================================================
+
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+
 // Copyright (C) ????-2008 - INRIA Michael Baudin
+
 //
+
 //  This file is distributed under the same license as the Scilab package.
+
 // =============================================================================
+
 function r=Err(x)
        r=norm(x,1)
 endfunction
 rand('normal')
+
+ilib_verbose(0);
+
+libName = [];
+
+if getos() == "Windows" then
+    libName = SCI + "/bin/elem_func";
+end
 //define tools
+
 function A=testmat1(a,n)
        //eigen values are given by a dilation of nth roots of 1
        A=diag(a*ones(1,n-1),1)+diag((1/a)*ones(1,n-1),-1)
        A(1,n)=1/a;A(n,1)=a
 endfunction
 //==========================================================================
-//==============================    schur     ==============================
+
+//==============================    schur     ============================== 
+
 //==========================================================================
+
 clear sel
+
 function t=sel(R),t=real(R)<0 ,endfunction
+
 //Empty matrix
+
 A=[];
+
 if schur(A)<>[] then bugmes();quit;end
+
 if schur(A,'real')<>[] then bugmes();quit;end
+
 if schur(A,'complex')<>[] then bugmes();quit;end
+
 if schur(A,'c')<>[] then bugmes();quit;end
+
 if schur(A,'d')<>[] then bugmes();quit;end
+
 if schur(A,sel)<>[] then bugmes();quit;end
+
 [U,S]=schur(A);
+
 if U<>[]|S<>[] then bugmes();quit;end
+
 [U,S]=schur(A,'real');
+
 if U<>[]|S<>[] then bugmes();quit;end
+
 [U,S]=schur(A,'complex');
+
 if U<>[]|S<>[] then bugmes();quit;end
+
 [U,N]=schur(A,'c');
+
 if U<>[]|N<>0 then bugmes();quit;end
+
 [U,N]=schur(A,'d');
+
 if U<>[]|N<>0 then bugmes();quit;end
+
 [U,N]=schur(A,sel);
+
 if U<>[]|N<>0 then bugmes();quit;end
+
 [U,N,S]=schur(A,'c');
+
 if U<>[]|N<>0|S<>[] then bugmes();quit;end
+
 [U,N,S]=schur(A,'d');
+
 if U<>[]|N<>0|S<>[] then bugmes();quit;end
+
 [U,N,S]=schur(A,sel);
+
 if U<>[]|N<>0|S<>[] then bugmes();quit;end
+
 //Rectangular matrix
+
 if execstr('schur(rand(2,3))','errcatch')==0 then bugmes();quit;end
+
 if execstr('[U,S]=schur(rand(2,3))','errcatch')==0 then bugmes();quit;end
+
 if execstr('schur(rand(2,3)+%i*eye())','errcatch')==0 then bugmes();quit;end
+
 if execstr('[U,S]=schur(rand(2,3)+%i*eye())','errcatch')==0 then bugmes();quit;end
+
 //Small dimension
+
 A=testmat1(3,5);Ac=testmat1(3+%i,5);
+
 //Real
+
 [U,S]=schur(A);
+
 if Err(triu(S,-1)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-A)>200*%eps then bugmes();quit;end
+
 if Err(schur(A)-S) >%eps then bugmes();quit;end
+
 [U,S]=schur(A,'real');
+
 if Err(triu(S,-1)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-A)>200*%eps then bugmes();quit;end
+
 if Err(schur(A)-S) >%eps then bugmes();quit;end
+
 [U,S]=schur(A,'complex');
+
 if Err(triu(S)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-A)>200*%eps then bugmes();quit;end
+
 if Err(schur(A,'complex')-S) >%eps then bugmes();quit;end
+
 [U,n]=schur(A,'c');S=U'*A*U;
+
 if n<>2 then bugmes();quit;end
+
 if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
 if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
 [U,n]=schur(A,'d');S=U'*A*U;
+
 if n<>0 then bugmes();quit;end
+
 if or(abs(spec(S(n+1:$,n+1:$)))<1) then bugmes();quit;end
+
 [U,n]=schur(A,sel);S=U'*A*U;
+
 if n<>2 then bugmes();quit;end
+
 if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
 if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
 //Complex
+
 [U,S]=schur(Ac);
+
 if Err(triu(S,-1)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-Ac)>200*%eps then bugmes();quit;end
+
 if Err(schur(Ac)-S) >%eps then bugmes();quit;end
+
 [U,S]=schur(Ac,'complex');
+
 if Err(triu(S,-1)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-Ac)>200*%eps then bugmes();quit;end
+
 if Err(schur(Ac)-S) >%eps then bugmes();quit;end
+
 [U,n]=schur(Ac,'c');S=U'*Ac*U;
+
 if n<>3 then bugmes();quit;end
+
 if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
 if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
 [U,n]=schur(Ac,'d');S=U'*A*U;
+
 if n<>0 then bugmes();quit;end
+
 if or(abs(spec(S(n+1:$,n+1:$)))<1) then bugmes();quit;end
+
 [U,n]=schur(Ac,sel);S=U'*Ac*U;
+
 if n<>3 then bugmes();quit;end
+
 if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
 if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
 //Large dimension
+
 A=testmat1(3,50);Ac=testmat1(3+%i,50);
+
 //Real
+
 [U,S]=schur(A);
+
 if Err(triu(S,-1)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-A)>1000*%eps then bugmes();quit;end
+
 if Err(schur(A)-S) >%eps then bugmes();quit;end
+
 [U,S]=schur(A,'real');
+
 if Err(triu(S,-1)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-A)>1000*%eps then bugmes();quit;end
+
 if Err(schur(A)-S) >%eps then bugmes();quit;end
+
 [U,S]=schur(A,'complex');
+
 if Err(triu(S)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-A)>1000*%eps then bugmes();quit;end
+
 if Err(schur(A,'complex')-S) >%eps then bugmes();quit;end
+
 [U,n]=schur(A,'c');S=U'*A*U;
+
 if n<>25 then bugmes();quit;end
+
 if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
 if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
 [U,n]=schur(A,'d');S=U'*A*U;
+
 if n<>0 then bugmes();quit;end
+
 if or(abs(spec(S(n+1:$,n+1:$)))<1) then bugmes();quit;end
+
 [U,n]=schur(A,sel);S=U'*A*U;
+
 if n<>25 then bugmes();quit;end
+
 if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
 if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
 //Complex
+
 [U,S]=schur(Ac);
+
 if Err(triu(S,-1)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-Ac)>1000*%eps then bugmes();quit;end
+
 if Err(schur(Ac)-S) >%eps then bugmes();quit;end
+
 [U,S]=schur(Ac,'complex');
+
 if Err(triu(S,-1)-S)>%eps then bugmes();quit;end
+
 if Err(U*S*U'-Ac)>1000*%eps then bugmes();quit;end
+
 if Err(schur(Ac)-S) >%eps then bugmes();quit;end
+
 [U,n]=schur(Ac,'c');S=U'*Ac*U;
+
 if n<>25 then bugmes();quit;end
+
 if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
 if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
 [U,n]=schur(Ac,'d');S=U'*Ac*U;
+
 if n<>0 then bugmes();quit;end
+
 if or(abs(spec(S(n+1:$,n+1:$)))<1) then bugmes();quit;end
+
 [U,n]=schur(Ac,sel);S=U'*Ac*U;
+
 if n<>25 then bugmes();quit;end
+
 if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
 if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
+// Lib part
+
+cd TMPDIR;
+
+// equal to schur(A, 'c');
+
+C=[ 'int mytest1(double* _real, double* _img)'
+    '{' 
+    '    return *_real < 0;'
+    '}'];
+
+mputl(C,TMPDIR+'/mytest.c');
+
+ulink();
+
+lp=ilib_for_link('mytest1','mytest.c',[],'c');
+
+exec loader.sce;
+
+[U,n]=schur(A,'mytest1');S=U'*A*U;
+
+if n<>25 then bugmes();quit;end
+
+if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
+if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
+// equal to schur(A, 'd');
+
+C=[ 'extern double dpythags(double,double);' // YaSp function
+    ''
+    'int mytest2(double* _real, double* _img)'
+    '{' 
+    '    return dpythags(*_real, *_img) < 1;'
+    '}'];
+
+mputl(C,TMPDIR+'/mytest.c');
+
+ulink();
+
+lp=ilib_for_link('mytest2','mytest.c', libName,'c');
+
+exec loader.sce;
+
+[U,n]=schur(A,'mytest2');S=U'*A*U;
+
+if n<>0 then bugmes();quit;end
+
+if or(abs(spec(S(n+1:$,n+1:$)))<1) then bugmes();quit;end
+
+// equal to schur(Ac, 'c');
+
+C=[ '#include ""doublecomplex.h""'
+    ''
+    'int mytest3(doublecomplex* _complex)'
+    '{'
+    '    return _complex->r < 0 ? 1 : 0;'
+    '}'];
+
+mputl(C,TMPDIR+'/mytest.c');
+
+ulink();
+
+lp=ilib_for_link('mytest3','mytest.c',[],'c');
+
+exec loader.sce;
+
+[U,n]=schur(Ac, 'mytest3');S=U'*Ac*U;
+
+if n<>25 then bugmes();quit;end
+
+if or(real(spec(S(1:n,1:n)))>=0) then bugmes();quit;end
+
+if or(real(spec(S(n+1:$,n+1:$)))<0) then bugmes();quit;end
+
+// equal to schur(Ac, 'd');
+
+C=[ '#include ""doublecomplex.h""'
+    ''
+    'extern double dpythags(double,double);' // YaSp function
+    ''
+    'int mytest4(doublecomplex* _complex)'
+    '{'
+    '    if(dpythags(_complex->r, _complex->i) < 1)'
+    '    {'
+    '        return 1;'
+    '    }'
+    '    else'
+    '    {'
+    '        return 0;'
+    '    }'
+    '}'];
+
+mputl(C,TMPDIR+'/mytest.c');
+
+ulink();
+
+lp=ilib_for_link('mytest4','mytest.c', libName,'c');
+
+exec loader.sce;
+
+[U,n]=schur(Ac,'mytest4');S=U'*Ac*U;
+
+if n<>0 then bugmes();quit;end
+
+if or(abs(spec(S(n+1:$,n+1:$)))<1) then bugmes();quit;end
+
 //==========================================================================
-//==============================    schur part II   ========================
+
+//==============================    schur part II   ======================== 
+
 //==========================================================================
+
 //Empty matrix
+
 [As,Es]=schur([],[]);
+
 if As<>[]|Es<>[] then bugmes();quit;end
+
 [As,dim]=schur([],[],'c');
+
 if As<>[]|dim<>0 then bugmes();quit;end
+
 [As,dim]=schur([],[],'d');
+
 if As<>[]|dim<>0 then bugmes();quit;end
+
 [As,dim]=schur([],[],sel);
+
 if As<>[]|dim<>0 then bugmes();quit;end
+
 [As,Es,Q,Z]=schur([],[]);
+
 if As<>[]|Es<>[]|Q<>[]|Z<>[] then bugmes();quit;end
+
 [As,Es,dim]=schur([],[],'c');
+
 if As<>[]|Es<>[]|dim<>0 then bugmes();quit;end
+
 [As,Es,dim]=schur([],[],'d');
+
 if As<>[]|Es<>[]|dim<>0 then bugmes();quit;end
+
 [As,Es,dim]=schur([],[],sel);
+
 if As<>[]|Es<>[]|dim<>0 then bugmes();quit;end
+
 [Z,dim]=schur([],[],'c');
+
 if Z<>[]|dim<>0 then bugmes();quit;end
+
 [Z,dim]=schur([],[],'d');
+
 if Z<>[]|dim<>0 then bugmes();quit;end
+
 [Z,dim]=schur([],[],sel);
+
 if Z<>[]|dim<>0 then bugmes();quit;end
+
 //Rectangular matrix
+
 if execstr('[As,Es]=schur(rand(2,3),rand(2,3))','errcatch')==0 then  bugmes();quit;end
+
 if execstr('[As,Es,Q,Z]=schur(rand(2,3),rand(2,3))','errcatch')==0 then  bugmes();quit;end
+
 if execstr('[As,Es,dim]=schur(rand(2,3),rand(2,3),''c'')','errcatch')==0 then  bugmes();quit;end
+
 if execstr('[Z,dim]=schur(rand(2,3),rand(2,3),sel)','errcatch')==0 then  bugmes();quit;end
+
 //Small dimension
+
 //----Real------------
-A=testmat1(1,5);E=testmat1(-2,5) ;
+
+A=testmat1(1,5);E=testmat1(-2,5) 
 [As,Es,Q,Z]=schur(A,E);
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 [As1,Es1]=schur(A,E);
+
 if Err(As1-As)>10*%eps then bugmes();quit;end
+
 if Err(Es1-Es)>10*%eps then bugmes();quit;end
+
 // Ordered 'c'
+
 dim=schur(A,E,'c');
+
 if dim<>5 then bugmes();quit;end
+
 [Z,dim]=schur(A,E,'c');
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 [Q,Z1,dim]=schur(A,E,'c');
+
 if Err(Z1-Z)>10*%eps then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if dim<>5 then bugmes();quit;end
-[As,Es,Z,dim]=schur(A,E,'d');
+
+[As,Es,Z,dim]=schur(A,E,'c');
+
 if dim<>5 then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 // Ordered 'd'
+
 dim=schur(A,E,'d');
+
 if dim<>5 then bugmes();quit;end
+
 [Z,dim]=schur(A,E,'d');
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 [Q,Z1,dim]=schur(A,E,'d');
+
 if Err(Z1-Z)>10*%eps then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if dim<>5 then bugmes();quit;end
+
 [As,Es,Z,dim]=schur(A,E,'d');
+
 if dim<>5 then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 //ordered sel
+
 clear sel
-function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction
+
+function t=sel(Alpha,Beta)
+    t = real(Alpha) > -0.2 * real(Beta);
+endfunction
 dim=schur(A,E,sel);
+
 if dim<>2 then bugmes();quit;end
+
 [Z,dim]=schur(A,E,sel);
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 [Q,Z1,dim]=schur(A,E,sel);
+
 if Err(Z1-Z)>10*%eps then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if dim<>2 then bugmes();quit;end
+
 [As,Es,Z,dim]=schur(A,E,sel);
+
 if dim<>2 then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 //----Complex------------
-A=testmat1(1+%i,5);E=testmat1(-2-3*%i,5) ;
+
+A=testmat1(1+%i,5);E=testmat1(-2-3*%i,5) 
 [As,Es,Q,Z]=schur(A,E);
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 [As1,Es1]=schur(A,E);
+
 if Err(As1-As)>10*%eps then bugmes();quit;end
+
 if Err(Es1-Es)>10*%eps then bugmes();quit;end
+
 // Ordered 'c'
+
 dim=schur(A,E,'c');
+
 if dim<>5 then bugmes();quit;end
+
 [Z,dim]=schur(A,E,'c');
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 [Q,Z1,dim]=schur(A,E,'c');
+
 if Err(Z1-Z)>10*%eps then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if dim<>5 then bugmes();quit;end
-[As,Es,Z,dim]=schur(A,E,'d');
+
+[As,Es,Z,dim]=schur(A,E,'c');
+
 if dim<>5 then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 // Ordered 'd'
+
 dim=schur(A,E,'d');
+
 if dim<>5 then bugmes();quit;end
+
 [Z,dim]=schur(A,E,'d');
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 [Q,Z1,dim]=schur(A,E,'d');
+
 if Err(Z1-Z)>10*%eps then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if dim<>5 then bugmes();quit;end
+
 [As,Es,Z,dim]=schur(A,E,'d');
+
 if dim<>5 then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 //ordered sel
+
 clear sel
+
 function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction
+
 dim=schur(A,E,sel);
+
 if dim<>3 then bugmes();quit;end
+
 [Z,dim]=schur(A,E,sel);
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 [Q,Z1,dim]=schur(A,E,sel);
+
 if Err(Z1-Z)>10*%eps then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if dim<>3 then bugmes();quit;end
+
 [As,Es,Z,dim]=schur(A,E,sel);
+
 if dim<>3 then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 //Large dimension
+
 //----Real------------
-A=testmat1(1,50);E=testmat1(-2,50) ;
+
+A=testmat1(1,50);E=testmat1(-2,50) 
 [As,Es,Q,Z]=schur(A,E);
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 [As1,Es1]=schur(A,E);
+
 if Err(As1-As)>10*%eps then bugmes();quit;end
+
 if Err(Es1-Es)>10*%eps then bugmes();quit;end
+
 // Ordered 'c'
+
 dim=schur(A,E,'c');
+
 if dim<>50 then bugmes();quit;end
+
 [Z,dim]=schur(A,E,'c');
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 [Q,Z1,dim]=schur(A,E,'c');
+
 if Err(Z1-Z)>10*%eps then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if dim<>50 then bugmes();quit;end
-[As,Es,Z,dim]=schur(A,E,'d');
+
+[As,Es,Z,dim]=schur(A,E,'c');
+
 if dim<>50 then bugmes();quit;end
+
 if Err(Q*Q'-eye(Q)) >200*%eps then bugmes();quit;end
+
 if Err(Z*Z'-eye(Z)) >200*%eps then bugmes();quit;end
+
 if Err(As-Q'*A*Z) >200*%eps then bugmes();quit;end
+
 if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
+
 // Ordered 'd'
+
 dim=schur(A,E,'d');
+
 if dim<>50