randlib plugged. 32/5632/7
Cedric Delamarre [Tue, 13 Dec 2011 13:35:23 +0000 (14:35 +0100)]
Change-Id: I9510d4ca9a284097d6f2fe8af20c425574ae8fb3

18 files changed:
scilab/etc/modules.xml.in
scilab/etc/modules.xml.vc
scilab/modules/functions_manager/includes/dynamic_modules.hxx
scilab/modules/functions_manager/includes/module_declaration.hxx
scilab/modules/functions_manager/src/cpp/dynamic_modules.cpp
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/randlib/Makefile.am
scilab/modules/randlib/Makefile.in
scilab/modules/randlib/includes/randlib_gw.hxx [new file with mode: 0644]
scilab/modules/randlib/sci_gateway/cpp/sci_grand.cpp [new file with mode: 0644]
scilab/modules/randlib/sci_gateway/randlib_gateway.xml
scilab/modules/randlib/src/c/randlib.vcxproj
scilab/modules/randlib/src/c/randlib.vcxproj.filters
scilab/modules/randlib/src/cpp/grand.cpp [new file with mode: 0644]
scilab/modules/randlib/tests/unit_tests/grand_clcg4.dia.ref
scilab/modules/randlib/tests/unit_tests/grand_clcg4.tst
scilab/modules/system_env/includes/configvariable.hxx
scilab/modules/system_env/src/cpp/configvariable.cpp

index 7abb8ad..6ba34ac 100644 (file)
@@ -46,5 +46,6 @@
     <module name="statistics" activate="yes"/>
     <module name="differential_equations" activate="yes"/>
     <module name="spreadsheet" activate="yes"/>
+    <module name="randlib" activate="yes"/>
 </modules>
 
index 2db24d7..2dc5d5a 100644 (file)
@@ -47,5 +47,6 @@
     <module name="statistics" activate="yes"/>
     <module name="differential_equations" activate="yes"/>
     <module name="spreadsheet" activate="yes"/>
+    <module name="randlib" activate="yes"/>
 </modules>
 
index fc424f4..032a18a 100644 (file)
@@ -106,4 +106,10 @@ public :
    static int Load();
 };
 
+class RandlibModule : public GenericModule
+{
+public :
+   static int Load();
+};
+
 #endif /* !__DYNAMIC_MODULES_HXX_ */
index fd4f1fa..3b2fd80 100644 (file)
@@ -42,4 +42,5 @@
 #include "dynamic_modules.hxx"
 #include "../../differential_equations/includes/differential_equations_gw.hxx"
 #include "../../spreadsheet/includes/spreadsheet_gw.hxx"
+#include "../../randlib/includes/randlib_gw.hxx"
 #endif /* !__MODULE_DECLARATION_HXX__ */
index 5f71e0c..e440554 100644 (file)
@@ -1,3 +1,15 @@
+/*
+* 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 "dynamic_modules.hxx"
 #include "context.hxx"
 #include "callDynamicGateway.hxx"
@@ -108,7 +120,7 @@ int ScinotesModule::Load()
 #endif
     vectGateway vect = loadGatewaysName(wstModuleName);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, &ScinotesModule::LoadDeps, wstModuleName));
     }
@@ -129,7 +141,7 @@ int FunctionsModule::Load()
 #endif
     vectGateway vect = loadGatewaysName(wstPath);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -149,7 +161,7 @@ int StatisticsModule::Load()
 #endif
     vectGateway vect = loadGatewaysName(wstPath);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -169,7 +181,7 @@ int SignalProcessingModule::Load()
 #endif
     vectGateway vect = loadGatewaysName(wstPath);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -198,7 +210,7 @@ int HelptoolsModule::Load()
 
     vectGateway vect = loadGatewaysName(wstModuleName);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -218,7 +230,7 @@ int MatioModule::Load()
 #endif
     vectGateway vect = loadGatewaysName(wstPath);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -236,7 +248,7 @@ int Hdf5Module::Load()
 #endif
     vectGateway vect = loadGatewaysName(wstModuleName);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -256,7 +268,7 @@ int ActionBindingModule::Load()
 #endif
     vectGateway vect = loadGatewaysName(wstPath);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -272,11 +284,10 @@ int DifferentialEquationsModule::Load()
     wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_1);
 #else
     wstring wstModuleName = L"differential_equations";
-    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_3);
 #endif
     vectGateway vect = loadGatewaysName(wstPath);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -284,6 +295,7 @@ int DifferentialEquationsModule::Load()
     return 1;
 }
 
+
 int SpreadsheetModule::Load()
 {
     wstring wstModuleName = L"spreadsheet";
@@ -294,7 +306,7 @@ int SpreadsheetModule::Load()
 #endif
     vectGateway vect = loadGatewaysName(wstModuleName);
 
-    for(int i = 0 ; i < vect.size() ; i++)
+    for(int i = 0 ; i < (int)vect.size() ; i++)
     {
         symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
@@ -302,3 +314,20 @@ int SpreadsheetModule::Load()
     return 1;
 }
 
+int RandlibModule::Load()
+{
+    wstring wstModuleName = L"randlib";
+#ifdef _MSC_VER
+    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_1);
+#else
+    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_3);
+#endif
+    vectGateway vect = loadGatewaysName(wstModuleName);
+
+    for(int i = 0 ; i < (int)vect.size() ; i++)
+    {
+        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+    }
+
+    return 1;
+}
index f3fb124..a5c8382 100644 (file)
@@ -309,6 +309,7 @@ bool FuncManager::CreateModuleList(void)
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"statistics", &StatisticsModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"differential_equations", &DifferentialEquationsModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"spreadsheet", &SpreadsheetModule::Load));
+    m_ModuleMap.insert(pair<wstring, GW_MOD>(L"randlib", &RandlibModule::Load));
 
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
index 369d707..6999591 100644 (file)
@@ -3,8 +3,8 @@
 #
 # This file is distributed under the same license as the Scilab package.
 
-
-RANDLIB_C_SOURCES = src/c/fsultra.c \
+RANDLIB_C_SOURCES = \
+src/c/fsultra.c \
 src/c/mt.c \
 src/c/igngeom.c \
 src/c/kiss.c \
@@ -39,25 +39,43 @@ src/fortran/gennor.f
 #src/fortran/ignpoi.f
 #src/fortran/sgamma.f
 
-GATEWAY_C_SOURCES = sci_gateway/c/gw_randlib.c \
-sci_gateway/c/sci_grand.c
-
-libscirandlib_la_CFLAGS=       -I$(srcdir)/includes/ \
-                               -I$(top_srcdir)/modules/output_stream/includes \
-                               -I$(top_srcdir)/modules/api_scilab/includes \
-                               -I$(top_srcdir)/modules/operations/includes
+RANDLIB_CPP_SOURCES = src/cpp/grand.cpp
+
+GATEWAY_CPP_SOURCES = sci_gateway/cpp/sci_grand.cpp
+
+libscirandlib_la_CFLAGS= \
+-I$(srcdir)/includes/ \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/operations/includes
+
+libscirandlib_la_CPPFLAGS= \
+-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/dynamic_link/includes \
+-I$(top_srcdir)/modules/symbol/includes \
+-I$(top_srcdir)/modules/ast/includes \
+-I$(top_srcdir)/modules/threads/includes \
+-I$(top_srcdir)/modules/system_env/includes \
+-I$(top_srcdir)/libs/dynamiclibrary/includes \
+-I$(top_srcdir)/modules/types/includes \
+-I$(top_srcdir)/modules/operations/includes \
+-I$(top_srcdir)/modules/elementary_functions/includes
 
 pkglib_LTLIBRARIES = libscirandlib.la
 noinst_LTLIBRARIES = libscirandlib-algo.la
 
 libscirandlib_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
 
-libscirandlib_algo_la_SOURCES = $(RANDLIB_C_SOURCES) $(RANDLIB_FORTRAN_SOURCES)
-libscirandlib_la_SOURCES = $(GATEWAY_C_SOURCES) 
+libscirandlib_algo_la_SOURCES = $(RANDLIB_CPP_SOURCES) $(RANDLIB_C_SOURCES) $(RANDLIB_FORTRAN_SOURCES)
+libscirandlib_la_SOURCES = $(GATEWAY_CPP_SOURCES)
 libscirandlib_algo_la_CFLAGS = $(libscirandlib_la_CFLAGS)
+libscirandlib_algo_la_CPPFLAGS = $(libscirandlib_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC= $(RANDLIB_C_SOURCES) $(GATEWAY_C_SOURCES)
+CHECK_SRC= $(RANDLIB_CPP_SOURCES) $(RANDLIB_C_SOURCES) $(GATEWAY_CPP_SOURCES)
 INCLUDE_FLAGS = $(libscirandlib_la_CFLAGS)
 
 libscirandlib_la_LIBADD =  libscirandlib-algo.la
index 20d211b..3566073 100644 (file)
@@ -110,7 +110,8 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" \
        "$(DESTDIR)$(libscirandlib_la_sci_gatewaydir)"
 LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libscirandlib_algo_la_LIBADD =
-am__objects_1 = libscirandlib_algo_la-fsultra.lo \
+am__objects_1 = libscirandlib_algo_la-grand.lo
+am__objects_2 = libscirandlib_algo_la-fsultra.lo \
        libscirandlib_algo_la-mt.lo libscirandlib_algo_la-igngeom.lo \
        libscirandlib_algo_la-kiss.lo libscirandlib_algo_la-urand.lo \
        libscirandlib_algo_la-clcg2.lo libscirandlib_algo_la-clcg4.lo \
@@ -118,19 +119,19 @@ am__objects_1 = libscirandlib_algo_la-fsultra.lo \
        libscirandlib_algo_la-ignpoi.lo \
        libscirandlib_algo_la-sgamma.lo \
        libscirandlib_algo_la-genbet.lo
-am__objects_2 = gennf.lo genchi.lo setgmn.lo gengam.lo snorm.lo \
+am__objects_3 = gennf.lo genchi.lo setgmn.lo gengam.lo snorm.lo \
        gennch.lo genmn.lo phrtsd.lo ignnbn.lo genf.lo genunf.lo \
        genexp.lo genmul.lo genprm.lo gennor.lo
-am_libscirandlib_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2)
+am_libscirandlib_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
+       $(am__objects_3)
 libscirandlib_algo_la_OBJECTS = $(am_libscirandlib_algo_la_OBJECTS)
 libscirandlib_la_DEPENDENCIES = libscirandlib-algo.la
-am__objects_3 = libscirandlib_la-gw_randlib.lo \
-       libscirandlib_la-sci_grand.lo
-am_libscirandlib_la_OBJECTS = $(am__objects_3)
+am__objects_4 = libscirandlib_la-sci_grand.lo
+am_libscirandlib_la_OBJECTS = $(am__objects_4)
 libscirandlib_la_OBJECTS = $(am_libscirandlib_la_OBJECTS)
-libscirandlib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libscirandlib_la_CFLAGS) \
-       $(CFLAGS) $(libscirandlib_la_LDFLAGS) $(LDFLAGS) -o $@
+libscirandlib_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(libscirandlib_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
@@ -144,6 +145,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)
@@ -417,7 +427,8 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
-RANDLIB_C_SOURCES = src/c/fsultra.c \
+RANDLIB_C_SOURCES = \
+src/c/fsultra.c \
 src/c/mt.c \
 src/c/igngeom.c \
 src/c/kiss.c \
@@ -452,23 +463,39 @@ src/fortran/gennor.f
 #src/fortran/ignbin.f
 #src/fortran/ignpoi.f
 #src/fortran/sgamma.f
-GATEWAY_C_SOURCES = sci_gateway/c/gw_randlib.c \
-sci_gateway/c/sci_grand.c
-
-libscirandlib_la_CFLAGS = -I$(srcdir)/includes/ \
-                               -I$(top_srcdir)/modules/output_stream/includes \
-                               -I$(top_srcdir)/modules/api_scilab/includes \
-                               -I$(top_srcdir)/modules/operations/includes
+RANDLIB_CPP_SOURCES = src/cpp/grand.cpp
+GATEWAY_CPP_SOURCES = sci_gateway/cpp/sci_grand.cpp
+libscirandlib_la_CFLAGS = \
+-I$(srcdir)/includes/ \
+-I$(top_srcdir)/modules/output_stream/includes \
+-I$(top_srcdir)/modules/api_scilab/includes \
+-I$(top_srcdir)/modules/operations/includes
+
+libscirandlib_la_CPPFLAGS = \
+-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/dynamic_link/includes \
+-I$(top_srcdir)/modules/symbol/includes \
+-I$(top_srcdir)/modules/ast/includes \
+-I$(top_srcdir)/modules/threads/includes \
+-I$(top_srcdir)/modules/system_env/includes \
+-I$(top_srcdir)/libs/dynamiclibrary/includes \
+-I$(top_srcdir)/modules/types/includes \
+-I$(top_srcdir)/modules/operations/includes \
+-I$(top_srcdir)/modules/elementary_functions/includes
 
 pkglib_LTLIBRARIES = libscirandlib.la
 noinst_LTLIBRARIES = libscirandlib-algo.la
 libscirandlib_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION)
-libscirandlib_algo_la_SOURCES = $(RANDLIB_C_SOURCES) $(RANDLIB_FORTRAN_SOURCES)
-libscirandlib_la_SOURCES = $(GATEWAY_C_SOURCES) 
+libscirandlib_algo_la_SOURCES = $(RANDLIB_CPP_SOURCES) $(RANDLIB_C_SOURCES) $(RANDLIB_FORTRAN_SOURCES)
+libscirandlib_la_SOURCES = $(GATEWAY_CPP_SOURCES)
 libscirandlib_algo_la_CFLAGS = $(libscirandlib_la_CFLAGS)
+libscirandlib_algo_la_CPPFLAGS = $(libscirandlib_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC = $(RANDLIB_C_SOURCES) $(GATEWAY_C_SOURCES)
+CHECK_SRC = $(RANDLIB_CPP_SOURCES) $(RANDLIB_C_SOURCES) $(GATEWAY_CPP_SOURCES)
 INCLUDE_FLAGS = $(libscirandlib_la_CFLAGS)
 libscirandlib_la_LIBADD = libscirandlib-algo.la
 
@@ -552,7 +579,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 \
@@ -624,7 +651,7 @@ clean-pkglibLTLIBRARIES:
          rm -f "$${dir}/so_locations"; \
        done
 libscirandlib-algo.la: $(libscirandlib_algo_la_OBJECTS) $(libscirandlib_algo_la_DEPENDENCIES) 
-       $(F77LINK)  $(libscirandlib_algo_la_OBJECTS) $(libscirandlib_algo_la_LIBADD) $(LIBS)
+       $(CXXLINK)  $(libscirandlib_algo_la_OBJECTS) $(libscirandlib_algo_la_LIBADD) $(LIBS)
 libscirandlib.la: $(libscirandlib_la_OBJECTS) $(libscirandlib_la_DEPENDENCIES) 
        $(libscirandlib_la_LINK) -rpath $(pkglibdir) $(libscirandlib_la_OBJECTS) $(libscirandlib_la_LIBADD) $(LIBS)
 
@@ -638,6 +665,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-clcg4.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-fsultra.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-genbet.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-grand.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-ignbin.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-igngeom.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-ignpoi.Plo@am__quote@
@@ -646,7 +674,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-sexpo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-sgamma.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_algo_la-urand.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_la-gw_randlib.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscirandlib_la-sci_grand.Plo@am__quote@
 
 .c.o:
@@ -671,102 +698,123 @@ distclean-compile:
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
 
 libscirandlib_algo_la-fsultra.lo: src/c/fsultra.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-fsultra.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-fsultra.Tpo -c -o libscirandlib_algo_la-fsultra.lo `test -f 'src/c/fsultra.c' || echo '$(srcdir)/'`src/c/fsultra.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-fsultra.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-fsultra.Tpo -c -o libscirandlib_algo_la-fsultra.lo `test -f 'src/c/fsultra.c' || echo '$(srcdir)/'`src/c/fsultra.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-fsultra.Tpo $(DEPDIR)/libscirandlib_algo_la-fsultra.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/fsultra.c' object='libscirandlib_algo_la-fsultra.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-fsultra.lo `test -f 'src/c/fsultra.c' || echo '$(srcdir)/'`src/c/fsultra.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-fsultra.lo `test -f 'src/c/fsultra.c' || echo '$(srcdir)/'`src/c/fsultra.c
 
 libscirandlib_algo_la-mt.lo: src/c/mt.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-mt.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-mt.Tpo -c -o libscirandlib_algo_la-mt.lo `test -f 'src/c/mt.c' || echo '$(srcdir)/'`src/c/mt.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-mt.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-mt.Tpo -c -o libscirandlib_algo_la-mt.lo `test -f 'src/c/mt.c' || echo '$(srcdir)/'`src/c/mt.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-mt.Tpo $(DEPDIR)/libscirandlib_algo_la-mt.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/mt.c' object='libscirandlib_algo_la-mt.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-mt.lo `test -f 'src/c/mt.c' || echo '$(srcdir)/'`src/c/mt.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-mt.lo `test -f 'src/c/mt.c' || echo '$(srcdir)/'`src/c/mt.c
 
 libscirandlib_algo_la-igngeom.lo: src/c/igngeom.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-igngeom.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-igngeom.Tpo -c -o libscirandlib_algo_la-igngeom.lo `test -f 'src/c/igngeom.c' || echo '$(srcdir)/'`src/c/igngeom.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-igngeom.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-igngeom.Tpo -c -o libscirandlib_algo_la-igngeom.lo `test -f 'src/c/igngeom.c' || echo '$(srcdir)/'`src/c/igngeom.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-igngeom.Tpo $(DEPDIR)/libscirandlib_algo_la-igngeom.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/igngeom.c' object='libscirandlib_algo_la-igngeom.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-igngeom.lo `test -f 'src/c/igngeom.c' || echo '$(srcdir)/'`src/c/igngeom.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-igngeom.lo `test -f 'src/c/igngeom.c' || echo '$(srcdir)/'`src/c/igngeom.c
 
 libscirandlib_algo_la-kiss.lo: src/c/kiss.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-kiss.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-kiss.Tpo -c -o libscirandlib_algo_la-kiss.lo `test -f 'src/c/kiss.c' || echo '$(srcdir)/'`src/c/kiss.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-kiss.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-kiss.Tpo -c -o libscirandlib_algo_la-kiss.lo `test -f 'src/c/kiss.c' || echo '$(srcdir)/'`src/c/kiss.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-kiss.Tpo $(DEPDIR)/libscirandlib_algo_la-kiss.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/kiss.c' object='libscirandlib_algo_la-kiss.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-kiss.lo `test -f 'src/c/kiss.c' || echo '$(srcdir)/'`src/c/kiss.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-kiss.lo `test -f 'src/c/kiss.c' || echo '$(srcdir)/'`src/c/kiss.c
 
 libscirandlib_algo_la-urand.lo: src/c/urand.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-urand.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-urand.Tpo -c -o libscirandlib_algo_la-urand.lo `test -f 'src/c/urand.c' || echo '$(srcdir)/'`src/c/urand.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-urand.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-urand.Tpo -c -o libscirandlib_algo_la-urand.lo `test -f 'src/c/urand.c' || echo '$(srcdir)/'`src/c/urand.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-urand.Tpo $(DEPDIR)/libscirandlib_algo_la-urand.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/urand.c' object='libscirandlib_algo_la-urand.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-urand.lo `test -f 'src/c/urand.c' || echo '$(srcdir)/'`src/c/urand.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-urand.lo `test -f 'src/c/urand.c' || echo '$(srcdir)/'`src/c/urand.c
 
 libscirandlib_algo_la-clcg2.lo: src/c/clcg2.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-clcg2.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-clcg2.Tpo -c -o libscirandlib_algo_la-clcg2.lo `test -f 'src/c/clcg2.c' || echo '$(srcdir)/'`src/c/clcg2.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-clcg2.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-clcg2.Tpo -c -o libscirandlib_algo_la-clcg2.lo `test -f 'src/c/clcg2.c' || echo '$(srcdir)/'`src/c/clcg2.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-clcg2.Tpo $(DEPDIR)/libscirandlib_algo_la-clcg2.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/clcg2.c' object='libscirandlib_algo_la-clcg2.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-clcg2.lo `test -f 'src/c/clcg2.c' || echo '$(srcdir)/'`src/c/clcg2.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-clcg2.lo `test -f 'src/c/clcg2.c' || echo '$(srcdir)/'`src/c/clcg2.c
 
 libscirandlib_algo_la-clcg4.lo: src/c/clcg4.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-clcg4.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-clcg4.Tpo -c -o libscirandlib_algo_la-clcg4.lo `test -f 'src/c/clcg4.c' || echo '$(srcdir)/'`src/c/clcg4.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-clcg4.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-clcg4.Tpo -c -o libscirandlib_algo_la-clcg4.lo `test -f 'src/c/clcg4.c' || echo '$(srcdir)/'`src/c/clcg4.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-clcg4.Tpo $(DEPDIR)/libscirandlib_algo_la-clcg4.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/clcg4.c' object='libscirandlib_algo_la-clcg4.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-clcg4.lo `test -f 'src/c/clcg4.c' || echo '$(srcdir)/'`src/c/clcg4.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-clcg4.lo `test -f 'src/c/clcg4.c' || echo '$(srcdir)/'`src/c/clcg4.c
 
 libscirandlib_algo_la-sexpo.lo: src/c/sexpo.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-sexpo.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-sexpo.Tpo -c -o libscirandlib_algo_la-sexpo.lo `test -f 'src/c/sexpo.c' || echo '$(srcdir)/'`src/c/sexpo.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-sexpo.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-sexpo.Tpo -c -o libscirandlib_algo_la-sexpo.lo `test -f 'src/c/sexpo.c' || echo '$(srcdir)/'`src/c/sexpo.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-sexpo.Tpo $(DEPDIR)/libscirandlib_algo_la-sexpo.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/sexpo.c' object='libscirandlib_algo_la-sexpo.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-sexpo.lo `test -f 'src/c/sexpo.c' || echo '$(srcdir)/'`src/c/sexpo.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-sexpo.lo `test -f 'src/c/sexpo.c' || echo '$(srcdir)/'`src/c/sexpo.c
 
 libscirandlib_algo_la-ignbin.lo: src/c/ignbin.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-ignbin.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-ignbin.Tpo -c -o libscirandlib_algo_la-ignbin.lo `test -f 'src/c/ignbin.c' || echo '$(srcdir)/'`src/c/ignbin.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-ignbin.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-ignbin.Tpo -c -o libscirandlib_algo_la-ignbin.lo `test -f 'src/c/ignbin.c' || echo '$(srcdir)/'`src/c/ignbin.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-ignbin.Tpo $(DEPDIR)/libscirandlib_algo_la-ignbin.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ignbin.c' object='libscirandlib_algo_la-ignbin.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-ignbin.lo `test -f 'src/c/ignbin.c' || echo '$(srcdir)/'`src/c/ignbin.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-ignbin.lo `test -f 'src/c/ignbin.c' || echo '$(srcdir)/'`src/c/ignbin.c
 
 libscirandlib_algo_la-ignpoi.lo: src/c/ignpoi.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-ignpoi.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-ignpoi.Tpo -c -o libscirandlib_algo_la-ignpoi.lo `test -f 'src/c/ignpoi.c' || echo '$(srcdir)/'`src/c/ignpoi.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-ignpoi.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-ignpoi.Tpo -c -o libscirandlib_algo_la-ignpoi.lo `test -f 'src/c/ignpoi.c' || echo '$(srcdir)/'`src/c/ignpoi.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-ignpoi.Tpo $(DEPDIR)/libscirandlib_algo_la-ignpoi.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/ignpoi.c' object='libscirandlib_algo_la-ignpoi.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-ignpoi.lo `test -f 'src/c/ignpoi.c' || echo '$(srcdir)/'`src/c/ignpoi.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-ignpoi.lo `test -f 'src/c/ignpoi.c' || echo '$(srcdir)/'`src/c/ignpoi.c
 
 libscirandlib_algo_la-sgamma.lo: src/c/sgamma.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-sgamma.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-sgamma.Tpo -c -o libscirandlib_algo_la-sgamma.lo `test -f 'src/c/sgamma.c' || echo '$(srcdir)/'`src/c/sgamma.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-sgamma.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-sgamma.Tpo -c -o libscirandlib_algo_la-sgamma.lo `test -f 'src/c/sgamma.c' || echo '$(srcdir)/'`src/c/sgamma.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-sgamma.Tpo $(DEPDIR)/libscirandlib_algo_la-sgamma.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/sgamma.c' object='libscirandlib_algo_la-sgamma.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-sgamma.lo `test -f 'src/c/sgamma.c' || echo '$(srcdir)/'`src/c/sgamma.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-sgamma.lo `test -f 'src/c/sgamma.c' || echo '$(srcdir)/'`src/c/sgamma.c
 
 libscirandlib_algo_la-genbet.lo: src/c/genbet.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-genbet.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-genbet.Tpo -c -o libscirandlib_algo_la-genbet.lo `test -f 'src/c/genbet.c' || echo '$(srcdir)/'`src/c/genbet.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -MT libscirandlib_algo_la-genbet.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-genbet.Tpo -c -o libscirandlib_algo_la-genbet.lo `test -f 'src/c/genbet.c' || echo '$(srcdir)/'`src/c/genbet.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_algo_la-genbet.Tpo $(DEPDIR)/libscirandlib_algo_la-genbet.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/genbet.c' object='libscirandlib_algo_la-genbet.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) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-genbet.lo `test -f 'src/c/genbet.c' || echo '$(srcdir)/'`src/c/genbet.c
-
-libscirandlib_la-gw_randlib.lo: sci_gateway/c/gw_randlib.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_la_CFLAGS) $(CFLAGS) -MT libscirandlib_la-gw_randlib.lo -MD -MP -MF $(DEPDIR)/libscirandlib_la-gw_randlib.Tpo -c -o libscirandlib_la-gw_randlib.lo `test -f 'sci_gateway/c/gw_randlib.c' || echo '$(srcdir)/'`sci_gateway/c/gw_randlib.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_la-gw_randlib.Tpo $(DEPDIR)/libscirandlib_la-gw_randlib.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/gw_randlib.c' object='libscirandlib_la-gw_randlib.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) $(libscirandlib_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_la-gw_randlib.lo `test -f 'sci_gateway/c/gw_randlib.c' || echo '$(srcdir)/'`sci_gateway/c/gw_randlib.c
-
-libscirandlib_la-sci_grand.lo: sci_gateway/c/sci_grand.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_la_CFLAGS) $(CFLAGS) -MT libscirandlib_la-sci_grand.lo -MD -MP -MF $(DEPDIR)/libscirandlib_la-sci_grand.Tpo -c -o libscirandlib_la-sci_grand.lo `test -f 'sci_gateway/c/sci_grand.c' || echo '$(srcdir)/'`sci_gateway/c/sci_grand.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscirandlib_la-sci_grand.Tpo $(DEPDIR)/libscirandlib_la-sci_grand.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_grand.c' object='libscirandlib_la-sci_grand.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) $(libscirandlib_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_la-sci_grand.lo `test -f 'sci_gateway/c/sci_grand.c' || echo '$(srcdir)/'`sci_gateway/c/sci_grand.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscirandlib_algo_la_CFLAGS) $(CFLAGS) -c -o libscirandlib_algo_la-genbet.lo `test -f 'src/c/genbet.c' || echo '$(srcdir)/'`src/c/genbet.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 $@ $<
+
+libscirandlib_algo_la-grand.lo: src/cpp/grand.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscirandlib_algo_la-grand.lo -MD -MP -MF $(DEPDIR)/libscirandlib_algo_la-grand.Tpo -c -o libscirandlib_algo_la-grand.lo `test -f 'src/cpp/grand.cpp' || echo '$(srcdir)/'`src/cpp/grand.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscirandlib_algo_la-grand.Tpo $(DEPDIR)/libscirandlib_algo_la-grand.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/grand.cpp' object='libscirandlib_algo_la-grand.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) $(libscirandlib_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscirandlib_algo_la-grand.lo `test -f 'src/cpp/grand.cpp' || echo '$(srcdir)/'`src/cpp/grand.cpp
+
+libscirandlib_la-sci_grand.lo: sci_gateway/cpp/sci_grand.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscirandlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscirandlib_la-sci_grand.lo -MD -MP -MF $(DEPDIR)/libscirandlib_la-sci_grand.Tpo -c -o libscirandlib_la-sci_grand.lo `test -f 'sci_gateway/cpp/sci_grand.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_grand.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscirandlib_la-sci_grand.Tpo $(DEPDIR)/libscirandlib_la-sci_grand.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_grand.cpp' object='libscirandlib_la-sci_grand.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) $(libscirandlib_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscirandlib_la-sci_grand.lo `test -f 'sci_gateway/cpp/sci_grand.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_grand.cpp
 
 .f.o:
        $(F77COMPILE) -c -o $@ $<
diff --git a/scilab/modules/randlib/includes/randlib_gw.hxx b/scilab/modules/randlib/includes/randlib_gw.hxx
new file mode 100644 (file)
index 0000000..df51fc2
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ *  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 __RANDLIB_GW_HXX__
+#define __RANDLIB_GW_HXX__
+
+#include "cpp_gateway_prototype.hxx"
+
+extern "C"
+{
+#include "dynlib_randlib.h"
+}
+
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_grand, RANDLIB_IMPEXP);
+
+#endif /* !__RANDLIB_GW_HXX__ */
diff --git a/scilab/modules/randlib/sci_gateway/cpp/sci_grand.cpp b/scilab/modules/randlib/sci_gateway/cpp/sci_grand.cpp
new file mode 100644 (file)
index 0000000..f9c72ea
--- /dev/null
@@ -0,0 +1,1365 @@
+/*
+* 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 "randlib_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "string.hxx"
+#include "configvariable.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "sciprint.h"
+#include "grand.h"
+#include "clcg4.h"
+#include "others_generators.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_grand(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    enum {MT, KISS, CLCG4, CLCG2, URAND, FSULTRA};
+
+    //  names at the scilab level
+    wchar_t* names_gen[6] = {L"mt", L"kiss", L"clcg4", L"clcg2", L"urand", L"fsultra"};
+
+    types::String* pStrMethod   = NULL;
+    types::String* pStrGenOrPhr = NULL;
+
+    std::vector<types::Double*> vectpDblInput;
+
+    int iStrPos     = 0;
+    int iPos        = 0;
+    int meth        = -1;
+    int iRows       = -1;
+    int iCols       = -1;
+    int iNumIter    = -1;
+
+    int current_base_gen = ConfigVariable::getCurrentBaseGen();
+
+// *** check the maximal number of input args. ***
+    if(in.size() > 6)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"grand", 1, 6);
+        return types::Function::Error;
+    }
+
+// *** check number of output args. ***
+    if(_iRetCount > 1)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"grand", 1);
+        return types::Function::Error;
+    }
+
+// *** find the mothod string. ***
+    for(int i = 0; i < in.size(); i++)
+    {
+        if(in[i]->isString())
+        {
+            pStrMethod = in[i]->getAs<types::String>();
+            iStrPos = i;
+            break;
+        }
+    }
+
+    if(pStrMethod == NULL)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): At least %d string expected.\n"), L"grand", 1);
+        return types::Function::Error;
+    }
+
+    wchar_t* wcsMeth = pStrMethod->get(0);
+    int iNumInputArg = 5;
+    if(wcscmp(wcsMeth, L"bet") == 0) // beta
+    {
+        meth = 1;
+    }
+    else if(wcscmp(wcsMeth,L"bin") == 0) // binomial
+    {
+        meth = 2;
+    }
+    else if(wcscmp(wcsMeth, L"nbn") == 0) // negative binomial
+    {
+        meth = 3;
+    }
+    else if(wcscmp(wcsMeth, L"chi") == 0) // chisquare
+    {
+        iNumInputArg = 4;
+        meth = 4;
+    }
+    else if(wcscmp(wcsMeth, L"nch") == 0) // non central chisquare
+    {
+        meth = 5;
+    }
+    else if(wcscmp(wcsMeth, L"exp") == 0) // exponential
+    {
+        iNumInputArg = 4;
+        meth = 6;
+    }
+    else if(wcscmp(wcsMeth, L"f") == 0) // F variance ratio
+    {
+        meth = 7;
+    }
+    else if(wcscmp(wcsMeth, L"nf") == 0) // non central F variance ratio
+    {
+        iNumInputArg = 6;
+        meth = 8;
+    }
+    else if(wcscmp(wcsMeth, L"gam") == 0) // gamma
+    {
+        meth = 9;
+    }
+    else if(wcscmp(wcsMeth, L"nor") == 0) // Gauss Laplace (normal)
+    {
+        meth = 10;
+    }
+    else if(wcscmp(wcsMeth, L"mn") == 0) // multivariate gaussian (multivariate normal)
+    {
+        iNumInputArg = 4;
+        meth = 11;
+    }
+    else if(wcscmp(wcsMeth, L"geom") == 0) // geometric
+    {
+        iNumInputArg = 4;
+        meth = 12;
+    }
+    else if(wcscmp(wcsMeth, L"markov") == 0) // markov
+    {
+        iNumInputArg = 4;
+        meth = 13;
+    }
+    else if(wcscmp(wcsMeth, L"mul") == 0) // multinomial
+    {
+        iNumInputArg = 4;
+        meth = 14;
+    }
+    else if(wcscmp(wcsMeth, L"poi") == 0) // Poisson
+    {
+        iNumInputArg = 4;
+        meth = 15;
+    }
+    else if(wcscmp(wcsMeth, L"prm") == 0) // random permutations
+    {
+        iNumInputArg = 3;
+        meth = 16;
+    }
+    else if(wcscmp(wcsMeth, L"def") == 0) // uniform (def)
+    {
+        iNumInputArg = 3;
+        meth = 17;
+    }
+    else if(wcscmp(wcsMeth, L"unf") == 0) // uniform (unf)
+    {
+        meth = 18;
+    }
+    else if(wcscmp(wcsMeth, L"uin") == 0) // uniform (uin)
+    {
+        meth = 19;
+    }
+    else if(wcscmp(wcsMeth, L"lgi") == 0) // uniform (lgi)
+    {
+        iNumInputArg = 3;
+        meth = 20;
+    }
+    else if(wcscmp(wcsMeth, L"getgen") == 0) // getgen
+    {
+        iNumInputArg = 1;
+        meth = 21;
+    }
+    else if(wcscmp(wcsMeth, L"setgen") == 0) // setgen
+    {
+        iNumInputArg = 2;
+        meth = 22;
+    }
+    else if(wcscmp(wcsMeth, L"getsd") == 0) // getsd
+    {
+        iNumInputArg = 1;
+        meth = 23;
+    }
+    else if(wcscmp(wcsMeth, L"setsd") == 0) // setsd
+    {
+        switch(current_base_gen)
+        {
+            case MT:        iNumInputArg = 2; break;
+            case KISS:      iNumInputArg = 5; break;
+            case CLCG2:     iNumInputArg = 3; break;
+            case CLCG4:     iNumInputArg = 5; break;
+            case URAND:     iNumInputArg = 2; break;
+            case FSULTRA:
+            {
+                if(in.size() != 2 && in.size() != 3)
+                {
+                    ScierrorW(77, _W("%ls: Wrong number of input argument(s) for method %ls: %d or %d expected.\n"), L"grand", wcsMeth, 2, 3);
+                    return types::Function::Error;
+                }
+
+                iNumInputArg = in.size();
+                break;
+            }
+        }
+        meth = 24;
+    }
+    else if(wcscmp(wcsMeth, L"phr2sd") == 0) // phr2sd
+    {
+        iNumInputArg = 2;
+        meth = 25;
+    }
+    else if(wcscmp(wcsMeth, L"setcgn") == 0) // setcgn
+    {
+        iNumInputArg = 2;
+        meth = 26;
+    }
+    else if(wcscmp(wcsMeth, L"getcgn") == 0) // getcgn
+    {
+        iNumInputArg = 1;
+        meth = 27;
+    }
+    else if(wcscmp(wcsMeth, L"initgn") == 0) // initgn
+    {
+        iNumInputArg = 2;
+        meth = 28;
+    }
+    else if(wcscmp(wcsMeth, L"setall") == 0) // setall
+    {
+        iNumInputArg = 5;
+        meth = 29;
+    }
+    else if(wcscmp(wcsMeth, L"advnst") == 0) // advnst
+    {
+        iNumInputArg = 2;
+        meth = 30;
+    }
+    else
+    {
+        ScierrorW(78, _W("%ls: Wrong method for input argument #%d: %ls unknown.\n"), L"grand", iStrPos+1, wcsMeth);
+        return types::Function::Error;
+    }
+
+// *** get arguments before methode string. ***
+    if(meth == 11 || meth == 13 || meth == 14 || meth == 16) // grand(n, "...", ...
+    {
+        if(iStrPos != 1)
+        {
+            ScierrorW(999, _W("%ls: Wrong position for input argument #%d : Must be in position %d.\n"), L"grand", iStrPos+1, 2);
+            return types::Function::Error;
+        }
+
+        if(in[iPos]->isDouble() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A matrix expected.\n"), L"grand", iPos+1);
+            return types::Function::Error;
+        }
+
+        types::Double* pDblTemp = in[iPos]->getAs<types::Double>();
+
+        if(pDblTemp->isScalar() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", iPos+1);
+            return types::Function::Error;
+        }
+
+        iNumIter = pDblTemp->get(0);
+        iPos++;
+    }
+    else if(meth < 21) // grand(m, n, "...", ... || grand(matrix, "...", ...
+    {
+        if(iStrPos != 1 && iStrPos != 2)
+        {
+            ScierrorW(999, _W("%ls: Wrong position for input argument #%d : Must be in position %d or %d.\n"), L"grand", iStrPos+1, 2, 3);
+            return types::Function::Error;
+        }
+
+        std::vector<types::Double*> vectpDblTemp;
+        for(int i = 0; i < iStrPos; i++)
+        {
+            if(in[iPos]->isDouble() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", iPos+1);
+                return types::Function::Error;
+            }
+
+            vectpDblTemp.push_back(in[iPos]->getAs<types::Double>());
+
+            if(iStrPos == 3 && vectpDblTemp[i]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", iPos+1);
+                return types::Function::Error;
+            }
+            iPos++;
+        }
+
+        if(iStrPos == 2)
+        {
+            iRows = static_cast<int>(vectpDblTemp[0]->get(0));
+            iCols = static_cast<int>(vectpDblTemp[1]->get(0));;
+        }
+        else // iStrPos == 2
+        {
+            iRows = vectpDblTemp[0]->getRows();
+            iCols = vectpDblTemp[0]->getCols();
+            iNumInputArg--;
+        }
+    }
+
+    if(in[iPos]->isString() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A string expected.\n"), L"grand", iPos+1);
+        return types::Function::Error;
+    }
+    iPos++; // method string has been already got.
+
+// *** check the number of input args according the methode. ***
+    if(in.size() != iNumInputArg)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s) for method %ls: %d expected.\n"), L"grand", wcsMeth, iNumInputArg);
+        return types::Function::Error;
+    }
+
+// *** get arguments after methode string. ***
+    if(meth == 22 || meth == 25) // setgen || phr2sd
+    {
+        if(in[iPos]->isString() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A string expected.\n"), L"grand", iPos+1);
+            return types::Function::Error;
+        }
+
+        pStrGenOrPhr = in[iPos]->getAs<types::String>();
+
+        if(pStrGenOrPhr->isScalar() == false)
+        {
+            ScierrorW(999, _W("%ls: Wrong size for input argument #%d : Only one string expected.\n"), L"grand", iPos+1);
+            return types::Function::Error;
+        }
+    }
+    else
+    {
+        for(int i = iPos; i < in.size(); i++)
+        {
+            if(in[i]->isDouble() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", iPos+1);
+                return types::Function::Error;
+            }
+
+            vectpDblInput.push_back(in[i]->getAs<types::Double>());
+        }
+    }
+
+// *** perform operation in according method string and return result. ***
+
+    switch(meth)
+    {
+        case 1: // beta
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+            double minlog   = 1.e-37;
+
+            for(int i = 0; i < 2; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+
+                if(vectpDblInput[i]->get(0) < minlog)
+                {
+                    ScierrorW(999, _W("%ls: Wrong value for input argument #%d : At least %lf expected.\n"), L"grand", iPos+1, minlog);
+                    return types::Function::Error;
+                }
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(genbet)(vectpDblInput[0]->get(),vectpDblInput[1]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 2: // binomial
+        case 3: // negative binomial
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < 2; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+            }
+
+            if(vectpDblInput[0]->get(0) < 0.0) // N
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive integer expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[1]->get(0) < 0.0 || vectpDblInput[1]->get(0) > 1.0) // p
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : A value  expected.\n"), L"grand", 5);
+                return types::Function::Error;
+            }
+
+            int N = static_cast<int>(vectpDblInput[0]->get(0));
+            if(meth == 2)
+            {
+                for(int i = 0; i < pDblOut->getSize(); i++)
+                {
+                    pDblOut->set(i, static_cast<double>(C2F(ignbin)(&N, vectpDblInput[1]->get())));
+                }
+            }
+            else // meth == 3
+            {
+                for(int i = 0; i < pDblOut->getSize(); i++)
+                {
+                    pDblOut->set(i, static_cast<double>(C2F(ignnbn)(&N, vectpDblInput[1]->get())));
+                }
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 4: // chisquare
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            if(vectpDblInput[0]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[0]->get(0) <= 0.0) // Df
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive no null value expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(genchi)(vectpDblInput[0]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 5: // non central chisquare
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < 2; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+            }
+
+            if(vectpDblInput[0]->get(0) < 1.0) // Df
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : value >1.0 expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[1]->get(0) < 0.0) // Xnon
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive value expected.\n"), L"grand", 5);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(gennch)(vectpDblInput[0]->get(), vectpDblInput[1]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 6: // exponential
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            if(vectpDblInput[0]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[0]->get(0) < 0.0) // Av
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive value expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(genexp)(vectpDblInput[0]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 7: // F variance ratio
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < 2; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+
+                if(vectpDblInput[i]->get(0) <= 0.0) // Dfn Dfd
+                {
+                    ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive no null value expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(genf)(vectpDblInput[0]->get(), vectpDblInput[1]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 8: // non F variance ratio
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < 3; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+            }
+
+            if(vectpDblInput[0]->get(0) < 1.0) // Dfn
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : value > 1.0 expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[1]->get(0) <= 0.0) // Dfd
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive non null value expected.\n"), L"grand", 5);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[2]->get(0) < 0.0) // Xnon
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive value expected.\n"), L"grand", 6);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(gennf)(vectpDblInput[0]->get(), vectpDblInput[1]->get(), vectpDblInput[2]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 9: // gamma
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < 2; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+
+                if(vectpDblInput[i]->get(0) <= 0.0)
+                {
+                    ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive non null value expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                //** WARNING ** : order is changed in parameters for
+                //compatibility between Rand(...'gam',..) and cdfgam
+
+                pDblOut->set(i, C2F(gengam)(vectpDblInput[1]->get(), vectpDblInput[0]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 10: // Gauss Laplace (normal)
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < 2; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+            }
+
+            if(vectpDblInput[1]->get(0) < 0.0)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive value expected.\n"), L"grand", 5);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(gennor)(vectpDblInput[0]->get(), vectpDblInput[1]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 11: // multivariate gaussian (multivariate normal)
+        {
+            if(vectpDblInput[0]->getCols() != 1 || vectpDblInput[0]->getSize() == 0)
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d : A matrix of size m x 1 expected.(m > 0)\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[0]->getRows() != vectpDblInput[1]->getRows())
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d and #%d: Mean and Cov have incompatible dimensions.\n"), L"grand", 4, 5);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[1]->getRows() != vectpDblInput[1]->getCols())
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d : A square symmetric positive definite matrix expected.\n"), L"grand", 5);
+                return types::Function::Error;
+            }
+
+            int ierr = 0;
+            int size = vectpDblInput[0]->getRows();
+            int mp   = (size * (size + 3)) / 2 + 1;
+
+            types::Double* pDblOut = new types::Double(size, iNumIter);
+            double* work  = (double*)malloc(size * sizeof(double));
+            double* param = (double*)malloc(mp   * sizeof(double));
+
+            types::Double* pDblMean = vectpDblInput[0]->clone()->getAs<types::Double>();
+            types::Double* pDblCov  = vectpDblInput[1]->clone()->getAs<types::Double>();
+
+            C2F(setgmn)(pDblMean->get(), pDblCov->get(), &size, &size, param, &ierr);
+
+            delete pDblMean;
+            delete pDblCov;
+
+            if(ierr == 1)
+            {
+                free(work);
+                free(param);
+                ScierrorW(999, _W("%ls: setgmn return with state %d.\n"), L"grand", ierr);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < iNumIter; i++)
+            {
+                C2F(genmn)(param, pDblOut->get() + (size * i), work);
+            }
+
+            free(work);
+            free(param);
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 12: // geometric
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+            double pmin = 1.3e-307;
+
+            if(vectpDblInput[0]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[0]->get(0) < pmin || vectpDblInput[0]->get(0) > 1.0)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Must be between %lf and %d.\n"), L"grand", 4, pmin, 1);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, igngeom(vectpDblInput[0]->get(0)));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 13: // markov
+        {
+            if( vectpDblInput[0]->getRows() != vectpDblInput[0]->getCols() &&
+                vectpDblInput[0]->getRows() != 1)
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d : A square matrix or a row vector expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[1]->getSize() == 0)
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d: No empty matrix expected.\n"), L"grand", 5);
+                return types::Function::Error;
+            }
+
+            int sizeOfX0 = vectpDblInput[1]->getSize();
+
+            for( int i = 0; i < sizeOfX0; i++)
+            {
+                if(vectpDblInput[1]->get(i) < 1 || (vectpDblInput[1]->get(i) - 1) >= vectpDblInput[0]->getCols())
+                {
+                    ScierrorW(999, _W("%ls: X0(%d) must be in the range [1,%d[.\n"), L"grand", i+1, vectpDblInput[0]->getCols() + 1);
+                    return types::Function::Error;
+                }
+            }
+
+            types::Double* pDblOut = new types::Double(sizeOfX0, iNumIter);
+            int size = vectpDblInput[0]->getSize() + vectpDblInput[0]->getCols();
+            double* work = (double*)malloc(size * sizeof(double));
+
+            for(int i = 0; i < vectpDblInput[0]->getRows(); i++)
+            {
+                double ptot = 0.0;
+                for(int j = 0; j < vectpDblInput[0]->getCols(); j++)
+                {
+                    int position = vectpDblInput[0]->getRows() * j + i;
+
+                    if(vectpDblInput[0]->get(position) < 0 || vectpDblInput[0]->get(position) > 1)
+                    {
+                        ScierrorW(999, _W("%ls: Wrong value for input argument #%d: P(%d,%d) must be in the range [0 1].\n"), L"grand", i+1, j+1);
+                        return types::Function::Error;
+                    }
+
+                    ptot += vectpDblInput[0]->get(position);
+                }
+
+                if(fabs(ptot - 1.0) > 1e-8)
+                {
+                    ScierrorW(999, _W("%ls: Sum of P(%d,1:%d)=%lf ~= 1.\n"), L"grand", i+1, vectpDblInput[0]->getCols(), ptot);
+                    return types::Function::Error;
+                }
+            }
+            // ** Computing the cumulative sum of the P matrix **
+
+            for(int i = 0; i < vectpDblInput[0]->getRows(); i++)
+            {
+                double cumsum = 0.0;
+                work[i] = 0.0;
+                for(int j = 1; j < vectpDblInput[0]->getCols() + 1; j++)
+                {
+                    cumsum += vectpDblInput[0]->get(vectpDblInput[0]->getRows() * (j - 1) + i);
+                    work[vectpDblInput[0]->getRows() * j + i] = cumsum;
+                }
+            }
+
+            for(int i = 0; i < vectpDblInput[1]->getSize(); i++)
+            {
+                int iCur = static_cast<int>(vectpDblInput[1]->get(i)) - 1;
+                for(int j = 0; j < iNumIter; j++)
+                {
+                    int niv = 0;
+                    double rr = C2F(ranf)();
+
+                    if(vectpDblInput[0]->getRows() == 1)
+                    {
+                        iCur = 0;
+                    }
+
+                    while(  rr >= work[iCur + vectpDblInput[0]->getRows() * niv] &&
+                            niv < (vectpDblInput[0]->getRows() + 1))
+                    {
+                        niv++;
+                    }
+
+                    // ** projection to avoid boundaries **
+                    niv = Max(Min(niv, vectpDblInput[0]->getCols()), 1);
+                    pDblOut->set(vectpDblInput[1]->getSize() * j + i, static_cast<double>(niv));
+                    iCur = niv - 1;
+                }
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 14: // multinomial
+        {
+            if(vectpDblInput[0]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d: A scalar expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[0]->get(0) < 0)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d: A positive scalar expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[1]->getCols() != 1 || vectpDblInput[1]->getRows() <= 0)
+            {
+                ScierrorW(999, _W("%ls: Wrong size for input argument #%d: A colomn vector expected.\n"), L"grand", 5);
+                return types::Function::Error;
+            }
+
+            double ptot = 0.0;
+            int ncat = vectpDblInput[1]->getRows() + 1;
+            types::Double* pDblOut = new types::Double(ncat, iNumIter);
+
+            for(int i = 0; i < vectpDblInput[1]->getCols(); i++)
+            {
+                if(vectpDblInput[1]->get(i) < 0.0 || vectpDblInput[1]->get(i) > 1.0)
+                {
+                    ScierrorW(999, _W("%ls: Wrong value for input argument #%d: P(%d) must be in the range [0 1].\n"), L"grand", 5, i+1);
+                    return types::Function::Error;
+                }
+                ptot += vectpDblInput[1]->get(i);
+            }
+
+            if(ptot > 1.0)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d: Sum of P(i) > 1.\n"), L"grand", 5);
+                return types::Function::Error;
+            }
+
+            int* piP    = (int*)malloc(vectpDblInput[0]->getSize() * sizeof(int));
+            int* piOut  = (int*)malloc(pDblOut->getSize() * sizeof(int));
+
+            for(int i = 0; i < vectpDblInput[0]->getSize(); i++)
+            {
+                piP[i] = static_cast<int>(vectpDblInput[0]->get(i));
+            }
+
+            for(int i = 0; i < iNumIter; i++)
+            {
+                C2F(genmul)(piP, vectpDblInput[1]->get(), &ncat,  + &piOut[ncat * i]);
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, static_cast<double>(piOut[i]));
+            }
+
+            free(piP);
+            free(piOut);
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 15: // Poisson
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            if(vectpDblInput[0]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[0]->get(0) < 0.0)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Positive value expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, static_cast<double>(C2F(ignpoi)(vectpDblInput[0]->get())));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 16: // random permutations
+        {
+            if(vectpDblInput[0]->getCols() != 1)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A colomn vector expected.\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            int iVectRows = vectpDblInput[0]->getRows();
+            types::Double* pDblOut = new types::Double(iVectRows, iNumIter);
+
+            for(int i = 0; i < iNumIter; i++)
+            {
+                for(int j = 0; j < iVectRows; j++)
+                {
+                    pDblOut->set(iVectRows * i + j, vectpDblInput[0]->get(j));
+                }
+                C2F(genprm)(pDblOut->get() + (iVectRows * i), &iVectRows);
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 17: // uniform (def)
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(ranf)());
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 18: // uniform (unf)
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < 2; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+            }
+
+            double low  = vectpDblInput[0]->get(0);
+            double high = vectpDblInput[1]->get(0);
+
+            if(low > high)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d and #%d: Low < High expected.\n"), L"grand", 4, 5);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, low + (high - low) * C2F(ranf)());
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 19: // uniform (uin)
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < 2; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+4);
+                    return types::Function::Error;
+                }
+            }
+
+            int low  = static_cast<int>(vectpDblInput[0]->get(0));
+            int high = static_cast<int>(vectpDblInput[1]->get(0));
+
+            if(low > high)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d and #%d: Low < High expected.\n"), L"grand", 4, 5);
+                return types::Function::Error;
+            }
+
+            if( low  != vectpDblInput[0]->get(0) ||
+                high != vectpDblInput[1]->get(0) ||
+                (high - low + 1) > 2147483561)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d and #%d: Low and High must be integers and (high - low + 1) <=  2147483561.\n"), L"grand", 4, 5);
+                return types::Function::Error;
+            }
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, C2F(ignuin)(vectpDblInput[0]->get(), vectpDblInput[1]->get()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 20: // uniform (lgi)
+        {
+            types::Double* pDblOut = new types::Double(iRows, iCols);
+
+            for(int i = 0; i < pDblOut->getSize(); i++)
+            {
+                pDblOut->set(i, static_cast<double>(ignlgi()));
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 21: // getgen
+        {
+            types::String* pStrOut = new types::String(names_gen[current_base_gen]);
+            out.push_back(pStrOut);
+            break;
+        }
+        case 22: // setgen
+        {
+            wchar_t* wcsGen = pStrGenOrPhr->get(0);
+
+            if(wcscmp(wcsGen, L"mt") == 0)
+            {
+                ConfigVariable::setCurrentBaseGen(MT);
+            }
+            else if(wcscmp(wcsGen, L"kiss") == 0)
+            {
+                ConfigVariable::setCurrentBaseGen(KISS);
+            }
+            else if(wcscmp(wcsGen, L"clcg4") == 0)
+            {
+                ConfigVariable::setCurrentBaseGen(CLCG4);
+            }
+            else if(wcscmp(wcsGen, L"clcg2") == 0)
+            {
+                ConfigVariable::setCurrentBaseGen(CLCG2);
+            }
+            else if(wcscmp(wcsGen, L"urand") == 0)
+            {
+                ConfigVariable::setCurrentBaseGen(URAND);
+            }
+            else if(wcscmp(wcsGen, L"fsultra") == 0)
+            {
+                ConfigVariable::setCurrentBaseGen(FSULTRA);
+            }
+            else
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d: '%ls', '%ls', '%ls', '%ls', '%ls' or '%ls' expected.\n"), L"grand", 2, L"mt", L"kiss", L"clcg4", L"clcg2", L"urand", L"fsultra");
+                return types::Function::Error;
+            }
+
+            int current_gen = ConfigVariable::getCurrentBaseGen();
+            types::String* pStrOut = new types::String(names_gen[current_gen]);
+            out.push_back(pStrOut);
+            break;
+        }
+        case 23: // getsd
+        {
+            types::Double* pDblOut = NULL;
+
+            switch(current_base_gen)
+            {
+                case MT:
+                {
+                    pDblOut = new types::Double(625, 1);
+                    get_state_mt(pDblOut->get());
+                    break;
+                }
+                case KISS:
+                {
+                    pDblOut = new types::Double(4, 1);
+                    get_state_kiss(pDblOut->get());
+                    break;
+                }
+                case CLCG4:
+                {
+                    pDblOut = new types::Double(4, 1);
+                    int current_clcg4 = ConfigVariable::getCurrentClcg4();
+                    get_state_clcg4(current_clcg4, pDblOut->get());
+                    break;
+                }
+                case CLCG2:
+                {
+                    pDblOut = new types::Double(2, 1);
+                    get_state_clcg2(pDblOut->get());
+                    break;
+                }
+                case URAND:
+                {
+                    pDblOut = new types::Double(1, 1);
+                    get_state_urand(pDblOut->get());
+                    break;
+                }
+                case FSULTRA:
+                {
+                    pDblOut = new types::Double(40, 1);
+                    get_state_fsultra(pDblOut->get());
+                    break;
+                }
+            }
+
+            out.push_back(pDblOut);
+            break;
+        }
+        case 24: // setsd
+        {
+            int ierr = 0;
+            switch(current_base_gen)
+            {
+                case MT:
+                {
+                    if(vectpDblInput[0]->isScalar())
+                    {
+                        ierr = set_state_mt_simple(vectpDblInput[0]->get(0));
+                    }
+                    else if(vectpDblInput[0]->getSize() != 625)
+                    {
+                        ierr = set_state_mt(vectpDblInput[0]->get());
+                    }
+                    else
+                    {
+                        ScierrorW(999, _W("%ls: Wrong size for input argument #%d : A scalar or a vector of size %d expected.\n"), L"grand", 4, 625);
+                        return types::Function::Error;
+                    }
+
+                    break;
+                }
+                case KISS:
+                case CLCG4:
+                {
+                    for(int i = 0; i < 4; i++)
+                    {
+                        if(vectpDblInput[i]->isScalar() == false)
+                        {
+                            ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+2);
+                            return types::Function::Error;
+                        }
+                    }
+
+                    if(current_base_gen == KISS)
+                    {
+                        ierr = set_state_kiss(  vectpDblInput[0]->get(0),
+                                                vectpDblInput[1]->get(0),
+                                                vectpDblInput[2]->get(0),
+                                                vectpDblInput[3]->get(0));
+                    }
+                    else // CLCG4
+                    {
+                        ierr = set_seed_clcg4(  ConfigVariable::getCurrentClcg4(),
+                                                vectpDblInput[0]->get(0),
+                                                vectpDblInput[1]->get(0),
+                                                vectpDblInput[2]->get(0),
+                                                vectpDblInput[3]->get(0));
+                    }
+
+                    break;
+                }
+                case CLCG2:
+                {
+                    for(int i = 0; i < 2; i++)
+                    {
+                        if(vectpDblInput[i]->isScalar() == false)
+                        {
+                            ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+2);
+                            return types::Function::Error;
+                        }
+                    }
+
+                    ierr = set_state_clcg2(vectpDblInput[0]->get(0), vectpDblInput[1]->get(0));
+                    break;
+                }
+                case URAND:
+                {
+                    if(vectpDblInput[0]->isScalar() == false)
+                    {
+                        ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", 2);
+                        return types::Function::Error;
+                    }
+
+                    ierr = set_state_urand(vectpDblInput[0]->get(0));
+                    break;
+                }
+                case FSULTRA:
+                {
+                    if(in.size() == 2)
+                    {
+                        if(vectpDblInput[0]->getRows() != 40 || vectpDblInput[0]->getCols() != 1)
+                        {
+                            ScierrorW(999, _W("%ls: Wrong size for input argument #%d : A vector of size %d x %d expected.\n"), L"grand", 2, 40, 1);
+                            return types::Function::Error;
+                        }
+
+                        ierr = set_state_fsultra(vectpDblInput[0]->get());
+                    }
+                    else // in.size() == 3
+                    {
+                        for(int i = 0; i < 2; i++)
+                        {
+                            if(vectpDblInput[i]->isScalar() == false)
+                            {
+                                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+2);
+                                return types::Function::Error;
+                            }
+                        }
+
+                        ierr = set_state_fsultra_simple(vectpDblInput[0]->get(0), vectpDblInput[1]->get(0));
+                    }
+
+                    break;
+                }
+            }
+
+            if(ierr == 0)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for the last %d input argument(s).\n"), L"grand", in.size() - 1);
+                return types::Function::Error;
+            }
+
+            break;
+        }
+        case 25: // phr2sd
+        {
+            if(pStrGenOrPhr->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : One string expected.\n"), L"grand", 2);
+                return types::Function::Error;
+            }
+
+            types::Double* pDblOut = new types::Double(1, 2);
+            int size = wcslen(pStrGenOrPhr->get(0));
+            int piOut[2];
+            char* strPhr = wide_string_to_UTF8(pStrGenOrPhr->get(0));
+
+            C2F(phrtsd)(strPhr, &size, piOut, piOut + 1, size);
+
+            pDblOut->set(0, static_cast<double>(piOut[0]));
+            pDblOut->set(1, static_cast<double>(piOut[1]));
+
+            FREE(strPhr);
+            out.push_back(pDblOut);
+            break;
+        }
+        case 26: // setcgn
+        {
+            if(current_base_gen != CLCG4)
+            {
+                sciprintW(_W("The %ls option affects only the %ls generator\n"), L"setcgn", L"clcg4");
+            }
+
+            if(vectpDblInput[0]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", 2);
+                return types::Function::Error;
+            }
+
+            if(vectpDblInput[0]->get(0) < 0 || vectpDblInput[0]->get(0) > Maxgen)
+            {
+               ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Must be between %d and %d.\n"), L"grand", 0, Maxgen);
+                return types::Function::Error;
+            }
+
+            ConfigVariable::setCurrentClcg4(static_cast<int>(vectpDblInput[0]->get(0)));
+            double dOut = static_cast<double>(ConfigVariable::getCurrentClcg4());
+            out.push_back(new types::Double(dOut));
+            break;
+        }
+        case 27: // getcgn
+        {
+            double dOut = static_cast<double>(ConfigVariable::getCurrentClcg4());
+            out.push_back(new types::Double(dOut));
+            break;
+        }
+        case 28: // initgn
+        {
+            SeedType where;
+            if(current_base_gen != CLCG4)
+            {
+                sciprintW(_W("The %ls option affects only the %ls generator\n"), L"initgn", L"clcg4");
+            }
+
+            if(vectpDblInput[0]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", 2);
+                return types::Function::Error;
+            }
+
+            if( vectpDblInput[0]->get(0) != 0 &&
+                vectpDblInput[0]->get(0) != -1 &&
+                vectpDblInput[0]->get(0) != 1)
+            {
+               ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Must be between %d, %d or %d.\n"), L"grand", 2, -1, 0, 1);
+                return types::Function::Error;
+            }
+
+            where = (SeedType)(int)(vectpDblInput[0]->get(0) + 1);
+            init_generator_clcg4(ConfigVariable::getCurrentClcg4(), where);
+            out.push_back(vectpDblInput[0]);
+            break;
+        }
+        case 29: // setall
+        {
+            if(current_base_gen != CLCG4)
+            {
+                sciprintW(_W("The %ls option affects only the %ls generator\n"), L"setall", L"clcg4");
+            }
+
+            for(int i = 0; i < 4; i++)
+            {
+                if(vectpDblInput[i]->isScalar() == false)
+                {
+                    ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", i+2);
+                    return types::Function::Error;
+                }
+            }
+
+            int ierr = set_initial_seed_clcg4(  vectpDblInput[0]->get(0),
+                                                vectpDblInput[1]->get(0),
+                                                vectpDblInput[2]->get(0),
+                                                vectpDblInput[3]->get(0));
+            if(ierr == 0)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for the last %d input argument(s).\n"), L"grand", 4);
+                return types::Function::Error;
+            }
+
+            out.push_back(pStrMethod);
+            break;
+        }
+        case 30: // advnst
+        {
+            if(current_base_gen != CLCG4)
+            {
+                sciprintW(_W("The %ls option affects only the %ls generator\n"), L"advnst", L"clcg4");
+            }
+
+            if(vectpDblInput[0]->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d : A scalar expected.\n"), L"grand", 2);
+                return types::Function::Error;
+            }
+
+            int k = static_cast<int>(vectpDblInput[0]->get(0));
+
+            if(k < 1)
+            {
+                ScierrorW(999, _W("%ls: Wrong value for input argument #%d : Must be > %d.\n"), L"grand", 2, 0);
+                return types::Function::Error;
+            }
+
+            advance_state_clcg4(ConfigVariable::getCurrentClcg4(), k);
+            out.push_back(new types::Double(static_cast<double>(k)));
+            break;
+        }
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+
index 38947fd..a77e195 100644 (file)
@@ -1,28 +1,23 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
-<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
-<GATEWAY name="randlib">
-<!-- =================== -->
+<!DOCTYPE module SYSTEM "../../functions/xml/gateway.dtd">
 <!--
+/*
+ *  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
+ *
+ */
  Scilab
  Interface description. In this file, we define the list of the function which
  will be available into Scilab and the link to the "native" function.
 
- gatewayId is the position in the hashtable 'Interfaces' defined in the
- file SCI/modules/core/src/c/callinterf.h
-
- primitiveId is the position in the hashtable '<module>Table Tab[]' defined
- in the file modules/<module>/sci_gateway/c/gw_<module>.c
-
- primitiveName is the name of the Scilab function
-
- @author Allan CORNET
- @author Sylvestre LEDRU
- @date INRIA 2007
- ===================
  Don't touch if you do not know what you are doing
 -->
-<!-- =================== -->
-
-<PRIMITIVE gatewayId="38" primitiveId="1" primitiveName="grand" />
-</GATEWAY>
\ No newline at end of file
+<module name="randlib">
+    <gateway name="sci_grand" function="grand" type="1" />
+</module>
index 5e39c7f..6c1dd92 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/hashtable;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/hashtable;../../../api_scilab/includes;../../../operations/includes;../../../types/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../system_env/includes;../../../threads/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;RANDLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -105,7 +105,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/hashtable;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/hashtable;../../../api_scilab/includes;../../../operations/includes;../../../types/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../system_env/includes;../../../threads/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;RANDLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -132,7 +132,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/hashtable;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/hashtable;../../../api_scilab/includes;../../../operations/includes;../../../types/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../system_env/includes;../../../threads/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;RANDLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -165,7 +165,7 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/hashtable;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../../libs/MALLOC/includes;../../../localization/includes;../../../core/includes;../../../output_stream/includes;../../../../libs/intl;../../../../libs/hashtable;../../../api_scilab/includes;../../../operations/includes;../../../types/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../system_env/includes;../../../threads/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;RANDLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -192,18 +192,18 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_grand.cpp" />
+    <ClCompile Include="..\cpp\grand.cpp" />
     <ClCompile Include="clcg2.c" />
     <ClCompile Include="clcg4.c" />
     <ClCompile Include="DllmainRandlib.c" />
     <ClCompile Include="fsultra.c" />
     <ClCompile Include="genbet.c" />
-    <ClCompile Include="..\..\sci_gateway\c\gw_randlib.c" />
     <ClCompile Include="ignbin.c" />
     <ClCompile Include="igngeom.c" />
     <ClCompile Include="ignpoi.c" />
     <ClCompile Include="kiss.c" />
     <ClCompile Include="mt.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_grand.c" />
     <ClCompile Include="sexpo.c" />
     <ClCompile Include="sgamma.c" />
     <ClCompile Include="urand.c" />
@@ -212,8 +212,8 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClInclude Include="..\..\includes\clcg4.h" />
     <ClInclude Include="..\..\includes\dynlib_randlib.h" />
     <ClInclude Include="..\..\includes\grand.h" />
-    <ClInclude Include="..\..\includes\gw_randlib.h" />
     <ClInclude Include="..\..\includes\others_generators.h" />
+    <ClInclude Include="..\..\includes\randlib_gw.hxx" />
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\locales\randlib.pot" />
@@ -240,6 +240,12 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
       <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </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>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index f8f24c1..9072289 100644 (file)
@@ -38,9 +38,6 @@
     <ClCompile Include="genbet.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\gw_randlib.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="ignbin.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -56,9 +53,6 @@
     <ClCompile Include="mt.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_grand.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sexpo.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="urand.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_grand.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\cpp\grand.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\clcg4.h">
     <ClInclude Include="..\..\includes\grand.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\gw_randlib.h">
+    <ClInclude Include="..\..\includes\others_generators.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\others_generators.h">
+    <ClInclude Include="..\..\includes\randlib_gw.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>
diff --git a/scilab/modules/randlib/src/cpp/grand.cpp b/scilab/modules/randlib/src/cpp/grand.cpp
new file mode 100644 (file)
index 0000000..8f6efa4
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+* 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"
+
+extern "C" {
+#include "grand.h"
+#include "clcg4.h"
+#include "others_generators.h"
+}
+
+#define NbGenInScilab 6
+/*--------------------------------------------------------------------------*/
+// clcg4 must be called with the virtual generator number
+unsigned int clcg4_with_gen(void)
+{
+    int current_clcg4 = ConfigVariable::getCurrentClcg4();
+    return clcg4(current_clcg4);
+}
+/*--------------------------------------------------------------------------*/
+double C2F(ranf)(void)
+{
+    //  pointers onto the generators func
+    unsigned int (*gen[NbGenInScilab])() = {randmt, kiss, clcg4_with_gen, clcg2, urandc, fsultra};
+
+    int current_gen = ConfigVariable::getCurrentBaseGen();
+
+    // the factors (1/(RngMaxInt+1)) to get reals in [0,1) :
+    double factor[NbGenInScilab] = {
+    2.3283064365386963e-10,  // mt
+    2.3283064365386963e-10,  // kiss
+    4.6566128752457969e-10,  // clcg4
+    4.6566130595601735e-10,  // clcg2
+    4.6566128730773926e-10,  // urand
+    2.3283064365386963e-10}; // fsultra
+
+    // random deviate from U[0,1)
+    return ((double)gen[current_gen]() * factor[current_gen]);
+}
+/*--------------------------------------------------------------------------*/
+double ignlgi(void)
+{
+    //  pointers onto the generators func
+    unsigned int (*gen[NbGenInScilab])() = {randmt, kiss, clcg4_with_gen, clcg2, urandc, fsultra};
+
+    int current_gen = ConfigVariable::getCurrentBaseGen();
+
+    // random deviate from Ui[0,RngMaxInt] (direct output of the current gen)
+    return ((double)gen[current_gen]());
+}
+/*--------------------------------------------------------------------------*/
+double C2F(ignuin)(double *a, double *b)
+{
+    /*  random deviate from Ui[a,b]
+    *  it is assumed that : (i)  a and b are integers (stored in double)
+    *                       (ii) b-a+1 <= RngMaxInt[current_gen]
+    *  (these verif are done at the calling level)
+    *
+    *  We use the classic method with a minor difference : to choose
+    *  uniformly an int in [a,b] (ie d=b-a+1 numbers) with a generator
+    *  which provides uniformly integers in [0,RngMaxInt] (ie m=RngMaxInt+1
+    *  numbers) we do the Euclidian division :
+    *                                           m = q d + r,   r in [0,d-1]
+    *
+    *  and accept only numbers l in [0, qd-1], then the output is k = a + (l mod d)
+    *  (ie numbers falling in [qd , RngMaxInt] are rejected).
+    *  The problem is that RngMaxInt is 2^32-1 for mt and kiss so that RngMaxInt+1 = 0
+    *  with the 32 bits unsigned int arithmetic. So in place of rejected r
+    *  numbers we reject r+1 by using RngMaxInt in place of m. The constraint is
+    *  then that (b-a+1) <= RngMaxInt and if we doesn't want to deal we each generator
+    *  we take (b-a+1) <= Min RngMaxInt =  2147483561 (clcg2)
+    */
+
+    // all the generators provided integers in [0, RngMaxInt] :
+    unsigned long RngMaxInt[NbGenInScilab] = {
+    4294967295ul,  // mt
+    4294967295ul,  // kiss
+    2147483646ul,  // clcg4
+    2147483561ul,  // clcg2
+    2147483647ul,  // urand
+    4294967295ul}; // fsultra
+
+    int current_gen = ConfigVariable::getCurrentBaseGen();
+
+    unsigned long k, d = (unsigned long)((*b-*a)+1), qd;
+
+    if(d == 1)
+    {
+        return(*a);
+    }
+
+    qd = RngMaxInt[current_gen] - RngMaxInt[current_gen] % d;
+
+    do
+    {
+        k = (unsigned long)ignlgi();
+    }
+    while(k >= qd);
+
+    return(*a + (double)(k % d));
+}
+
index 413af85..0235eaf 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.
+
 // =============================================================================
+
 grand('setgen','clcg4');
+
 // Low level test for grand
+
 //**********************************************************************
+
 //     A test program for the bottom level routines
+
 //     Scilab implementation of tstbot.f
+
 //**********************************************************************
-NB       = 10
- NB  =
-    10.  
-NR       = 1000
- NR  =
-    1000.  
+
+NB       = 10;
+
+NR       = 1000;
+
 answer   = ones(NB,NR);
-genlst   = [1,5,10,20,32]
- genlst  =
-    1.    5.    10.    20.    32.  
+
+genlst   = [1,5,10,20,32];
+
 nbad     = 0;
-str      = ['For five virtual generators of the 101';..
-                       ' This test generates'+string(NB)+' numbers then resets the block';..
-                       '      and does it again';..
-                       ' Any disagreements are reported -- there should be none'];
-                       
-write (%io(2),str);
+
+str      = ['For five virtual generators of the 101\n' ..
+           +' This test generates '+string(NB)+' numbers then resets the block\n'..
+           +'      and does it again\n' ..
+           +' Any disagreements are reported -- there should be none'];
+
+mprintf(str)
 For five virtual generators of the 101
- This test generates10 numbers then resets the block
+ This test generates 10 numbers then resets the block
       and does it again
  Any disagreements are reported -- there should be none
 //
+
 //     Set up Generators
+
 //
+
 grand('setall',12345,54321,6789,9876);
+
 //
+
 //     For a selected set of generators
+
 //
+
 for ixgen = 1:5
-       igen = genlst(ixgen)
-       grand('setcgn',igen);
-       write(%io(2),' Testing generator '+string(igen));
-       //
-       //     Use NB blocks
-       //
-       grand('initgn',-1);
-       SD=grand('getsd');iseed1=SD(1);iseed2=SD(2);
-       for iblock = 1:NB
-               //     Generate NR numbers
-               answer(iblock,1:NR)= grand(1,NR,'lgi');
-               grand('initgn',1);
-       end
-       grand('initgn',-1);
-       //
-       //     Do it again and compare answers
-       //
-       SD=grand('getsd');iseed1=SD(1);iseed2=SD(2);
-       //
-       //     Use NB blocks
-       //
-       for iblock = 1:NB
-               
-               //     Generate NR numbers
-               itmp = grand(1,NR,'lgi');
-               if itmp<>answer(iblock,:) then
-                       str=[' Disagreement on regeneration of numbers';...
-                       ' Block '+string(iblock)+' N within Block '];
-                       write(%io(2),str);
-               end
-               
-               if itmp<>answer(iblock,:) then bugmes();quit;end
-               
-               grand('initgn',1);
-               
-       end
+    igen = genlst(ixgen)
+    grand('setcgn',igen);
+    mprintf(' Testing generator '+string(igen));
+    //
+    //     Use NB blocks
+    //
+    grand('initgn',-1);
+    SD=grand('getsd');iseed1=SD(1);iseed2=SD(2);
+    for iblock = 1:NB
+        //     Generate NR numbers
+        answer(iblock,1:NR)= grand(1,NR,'lgi');
+        grand('initgn',1);
+    end
+    grand('initgn',-1);
+    //
+    //     Do it again and compare answers
+    //
+    SD=grand('getsd');iseed1=SD(1);iseed2=SD(2);
+    //
+    //     Use NB blocks
+    //
+    for iblock = 1:NB
+        //     Generate NR numbers
+        itmp = grand(1,NR,'lgi');
+        if itmp<>answer(iblock,:) then
+            str=[' Disagreement on regeneration of numbers' ..
+                +' Block '+string(iblock)+' N within Block '];
+            mprintf(str);
+        end
+
+        if itmp<>answer(iblock,:) then bugmes();quit;end
+
+        grand('initgn',1);
+    end
+
+    mprintf(' Finished testing generator '+string(igen)+'\n');
+    mprintf(' Test completed successfully');
        
-       write (%io(2), ' Finished testing generator '+string(igen));
-       write (%io(2), ' Test completed successfully');
-       
-end
- igen  =
-    1.  
- Testing generator 1
- Finished testing generator 1
- Test completed successfully
- igen  =
-    5.  
- Testing generator 5
- Finished testing generator 5
- Test completed successfully
- igen  =
-    10.  
- Testing generator 10
- Finished testing generator 10
- Test completed successfully
- igen  =
-    20.  
- Testing generator 20
- Finished testing generator 20
- Test completed successfully
- igen  =
-    32.  
- Testing generator 32
- Finished testing generator 32
+endigen  = 
+
+  1
+ Testing generator 1 Finished testing generator 1
+ Test completed successfullyigen  = 
+
+  5
+ Testing generator 5 Finished testing generator 5
+ Test completed successfullyigen  = 
+
+  10
+ Testing generator 10 Finished testing generator 10
+ Test completed successfullyigen  = 
+
+  20
+ Testing generator 20 Finished testing generator 20
+ Test completed successfullyigen  = 
+
+  32
+ Testing generator 32 Finished testing generator 32
  Test completed successfully
index c7f3e76..5865b85 100644 (file)
@@ -13,18 +13,18 @@ grand('setgen','clcg4');
 //     A test program for the bottom level routines
 //     Scilab implementation of tstbot.f
 //**********************************************************************
-NB       = 10
-NR       = 1000
+NB       = 10;
+NR       = 1000;
 answer   = ones(NB,NR);
-genlst   = [1,5,10,20,32]
+genlst   = [1,5,10,20,32];
 nbad     = 0;
 
-str      = ['For five virtual generators of the 101';..
-                       ' This test generates'+string(NB)+' numbers then resets the block';..
-                       '      and does it again';..
-                       ' Any disagreements are reported -- there should be none'];
-                       
-write (%io(2),str);
+str      = ['For five virtual generators of the 101\n' ..
+           +' This test generates '+string(NB)+' numbers then resets the block\n'..
+           +'      and does it again\n' ..
+           +' Any disagreements are reported -- there should be none'];
+
+mprintf(str)
 
 //
 //     Set up Generators
@@ -37,44 +37,42 @@ grand('setall',12345,54321,6789,9876);
 //
 
 for ixgen = 1:5
-       igen = genlst(ixgen)
-       grand('setcgn',igen);
-       write(%io(2),' Testing generator '+string(igen));
-       //
-       //     Use NB blocks
-       //
-       grand('initgn',-1);
-       SD=grand('getsd');iseed1=SD(1);iseed2=SD(2);
-       for iblock = 1:NB
-               //     Generate NR numbers
-               answer(iblock,1:NR)= grand(1,NR,'lgi');
-               grand('initgn',1);
-       end
-       grand('initgn',-1);
-       //
-       //     Do it again and compare answers
-       //
-       SD=grand('getsd');iseed1=SD(1);iseed2=SD(2);
-       //
-       //     Use NB blocks
-       //
-       for iblock = 1:NB
-               
-               //     Generate NR numbers
-               itmp = grand(1,NR,'lgi');
-               if itmp<>answer(iblock,:) then
-                       str=[' Disagreement on regeneration of numbers';...
-                       ' Block '+string(iblock)+' N within Block '];
-                       write(%io(2),str);
-               end
-               
-               if itmp<>answer(iblock,:) then pause,end
-               
-               grand('initgn',1);
-               
-       end
-       
-       write (%io(2), ' Finished testing generator '+string(igen));
-       write (%io(2), ' Test completed successfully');
+    igen = genlst(ixgen)
+    grand('setcgn',igen);
+    mprintf(' Testing generator '+string(igen));
+    //
+    //     Use NB blocks
+    //
+    grand('initgn',-1);
+    SD=grand('getsd');iseed1=SD(1);iseed2=SD(2);
+    for iblock = 1:NB
+        //     Generate NR numbers
+        answer(iblock,1:NR)= grand(1,NR,'lgi');
+        grand('initgn',1);
+    end
+    grand('initgn',-1);
+    //
+    //     Do it again and compare answers
+    //
+    SD=grand('getsd');iseed1=SD(1);iseed2=SD(2);
+    //
+    //     Use NB blocks
+    //
+    for iblock = 1:NB
+        //     Generate NR numbers
+        itmp = grand(1,NR,'lgi');
+        if itmp<>answer(iblock,:) then
+            str=[' Disagreement on regeneration of numbers' ..
+                +' Block '+string(iblock)+' N within Block '];
+            mprintf(str);
+        end
+
+        if itmp<>answer(iblock,:) then pause,end
+
+        grand('initgn',1);
+    end
+
+    mprintf(' Finished testing generator '+string(igen)+'\n');
+    mprintf(' Test completed successfully');
        
 end
index f156064..4354efa 100644 (file)
@@ -279,6 +279,18 @@ private :
 public :
     static void setSchurFunction(types::Callable* _schurFunction);
     static types::Callable* getSchurFunction();
+
+    //grand (module randlib)
+private :
+    static int m_currentBaseGen;
+    static int m_currentClcg4;
+
+public :
+    static void setCurrentBaseGen(int _currentBaseGen);
+    static int getCurrentBaseGen();
+
+    static void setCurrentClcg4(int _currentClcg4);
+    static int getCurrentClcg4();
 };
 
 #endif /* !__CONFIGVARIABLE_HXX__ */
index 4e4d00d..d4dea47 100644 (file)
@@ -820,3 +820,40 @@ types::Callable* ConfigVariable::getSchurFunction()
 /*
 ** \}
 */
+
+/*
+** grand (module randlib)
+** \{
+*/
+
+int ConfigVariable::m_currentBaseGen = 0;
+int ConfigVariable::m_currentClcg4   = 0;
+
+void ConfigVariable::setCurrentBaseGen(int _gen)
+{
+    m_currentBaseGen = _gen;
+}
+
+int ConfigVariable::getCurrentBaseGen()
+{
+    return m_currentBaseGen;
+}
+
+void ConfigVariable::setCurrentClcg4(int _clcg4)
+{
+    m_currentClcg4 = _clcg4;
+}
+
+int ConfigVariable::getCurrentClcg4()
+{
+    return m_currentClcg4;
+}
+/*
+** \}
+*/
+
+
+
+
+
+