Salome HOME
Merge remote branch 'origin/ilh/pmml'
authorvsr <vsr@opencascade.com>
Wed, 10 Sep 2014 11:34:20 +0000 (15:34 +0400)
committervsr <vsr@opencascade.com>
Wed, 10 Sep 2014 11:34:20 +0000 (15:34 +0400)
41 files changed:
src/pmml/CMakeLists.txt
src/pmml/Test/CMakeLists.txt
src/pmml/Test/PMMLBasicsTest1.cxx
src/pmml/Test/samples/CMakeLists.txt [new file with mode: 0755]
src/pmml/Test/samples/ann_model.pmml [new file with mode: 0755]
src/pmml/Test/samples/ann_model_2.pmml [new file with mode: 0755]
src/pmml/Test/samples/lr_model.pmml [new file with mode: 0755]
src/pmml/Test/samples/lr_model_2.pmml [new file with mode: 0755]
src/pmml/Test/samples/no_model.pmml [new file with mode: 0755]
src/pmml/Test/samples/two_models_ann_lr.pmml [new file with mode: 0755]
src/pmml/Test/samples/unittest_ref_ann_model.cpp [new file with mode: 0755]
src/pmml/Test/samples/unittest_ref_ann_model.f [new file with mode: 0755]
src/pmml/Test/samples/unittest_ref_ann_model.py [new file with mode: 0755]
src/pmml/Test/samples/unittest_ref_lr_model.cpp [new file with mode: 0755]
src/pmml/Test/samples/unittest_ref_lr_model.f [new file with mode: 0755]
src/pmml/Test/samples/unittest_ref_lr_model.py [new file with mode: 0755]
src/pmml/Test/samples/win32_ann_model.pmml [new file with mode: 0755]
src/pmml/Test/samples/win32_lr_model.pmml [new file with mode: 0755]
src/pmml/pmml_swig/PMMLBasicsTest.py
src/pmml/resources/CMakeLists.txt [deleted file]
src/pmml/resources/ann_model.pmml [deleted file]
src/pmml/resources/ann_model_2.pmml [deleted file]
src/pmml/resources/lr_model.pmml [deleted file]
src/pmml/resources/lr_model_2.pmml [deleted file]
src/pmml/resources/no_model.pmml [deleted file]
src/pmml/resources/two_models_ann_lr.pmml [deleted file]
src/pmml/resources/unittest_ref_ann_model.cpp [deleted file]
src/pmml/resources/unittest_ref_ann_model.f [deleted file]
src/pmml/resources/unittest_ref_ann_model.py [deleted file]
src/pmml/resources/unittest_ref_lr_model.cpp [deleted file]
src/pmml/resources/unittest_ref_lr_model.f [deleted file]
src/pmml/resources/unittest_ref_lr_model.py [deleted file]
src/pmml/resources/win32_ann_model.pmml [deleted file]
src/pmml/resources/win32_lr_model.pmml [deleted file]
src/yacsloader/CMakeLists.txt
src/yacsloader/Test/CMakeLists.txt
src/yacsloader/pmml/CMakeLists.txt
src/yacsloader/pmml/PmmlExeTest.sh.in [new file with mode: 0755]
src/yacsloader/pmml/PmmlInSessionTest.sh.in [new file with mode: 0755]
src/yacsloader/pmml/YACSPMMLBasicsTest1.cxx
src/yacsloader/pmml/config_appli.xml.in [new file with mode: 0644]

index a6709da84afe66339d8a8a9c94ab2f582b4a1edb..b9d5d923dcd477772a6833467cd8669b155467a4 100755 (executable)
@@ -66,7 +66,6 @@ IF(SALOME_YACS_USE_SWIG)
     "Install path: SALOME Python shared modules")
 ENDIF(SALOME_YACS_USE_SWIG)
 
-SET(SALOME_INSTALL_RES share/salome/resources CACHE PATH "Install path: SALOME resources")
 SET(SALOME_PMML_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/pmml" CACHE PATH "Install path: SALOME PMML specific data")
 
 # Sources 
@@ -92,8 +91,6 @@ SET(pmml_SOURCES
   PMMLlib.cxx
   )
 
-ADD_SUBDIRECTORY(resources)
-
 ADD_LIBRARY(pmmlLib SHARED ${pmml_SOURCES})
 TARGET_LINK_LIBRARIES(pmmlLib  ${LIBXML2_LIBRARIES} ) 
 INSTALL(TARGETS pmmlLib EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
index 01984504de7b5d85274a76518b9aefd8e24b9621..b079a9050cf8d40c2c06f23916283609377b0f21 100755 (executable)
@@ -95,4 +95,5 @@ ENDIF(URANIE AND WIN32)
 
 ADD_TEST(TestPMML TestPMML)
 
+FILE(COPY ${PROJECT_SOURCE_DIR}/src/pmml/Test/samples  DESTINATION . )
 INSTALL(TARGETS TestPMML DESTINATION ${SALOME_INSTALL_BINS})
index f99a70d07e8337a78fc81c17cc19f1de5a2c4d11..c30b90039c288516c731170c454d9e674581f4ca 100755 (executable)
@@ -27,20 +27,13 @@ using namespace std;
 
 void PMMLBasicsTest1::setUp()
 {
+    resourcesDir = "samples/";
 #ifdef WIN32
-    const char* p = std::getenv("YACS_ROOT_DIR");
-    std::string strP("");
-    if (p) 
-        strP = std::string(p);
-    else 
-        throw std::string("unable to get YACS_ROOT_DIR");
-    resourcesDir = strP;
-    resourcesDir += "/share/salome/resources/pmml/";
     const char* user = std::getenv("USERPROFILE");
     std::string strUser("");
-    if (user) 
+    if (user)
         strUser = std::string(user);
-    else 
+    else
         throw std::string("unable to get USERPROFILE");
     tmpDir = strUser;
     tmpDir += "\\tmp";
@@ -48,14 +41,12 @@ void PMMLBasicsTest1::setUp()
     std::string cmd = "mkdir " + tmpDir; 
     system( cmd.c_str() );  
 #else
-    resourcesDir =  getenv("YACS_ROOT_DIR");
-    resourcesDir += "/share/salome/resources/pmml/";
     tmpDir = "/tmp/";
     tmpDir += getenv("USER");
     tmpDir += "/PmmlUnitTest/";
     std::string cmd = "mkdir -p " + tmpDir; 
     system( cmd.c_str() );  
-#endif    
+#endif
 }
 
 void PMMLBasicsTest1::tearDown()
diff --git a/src/pmml/Test/samples/CMakeLists.txt b/src/pmml/Test/samples/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..68c41e5
--- /dev/null
@@ -0,0 +1,45 @@
+# Copyright (C) 2012-2014  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(PMML_RESOURCES_FILES
+  # ici les noms des fichiers ressources 
+  ann_model.pmml
+  ann_model_2.pmml
+  lr_model.pmml
+  lr_model_2.pmml
+  no_model.pmml
+  two_models_ann_lr.pmml
+  unittest_ref_ann_model.cpp
+  unittest_ref_ann_model.f
+  unittest_ref_ann_model.py
+  unittest_ref_lr_model.cpp
+  unittest_ref_lr_model.f
+  unittest_ref_lr_model.py
+  win32_ann_model.pmml
+  win32_lr_model.pmml 
+  )
+
+INSTALL(FILES ${PMML_RESOURCES_FILES} DESTINATION ${SALOME_PMML_INSTALL_RES_DATA})
+
+# MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml")
+# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/PMMLCatalog.xml.in ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml @ONLY)
+# MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml")
+# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml @ONLY)
+
+# INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${SALOME_PMML_INSTALL_RES_DATA})
diff --git a/src/pmml/Test/samples/ann_model.pmml b/src/pmml/Test/samples/ann_model.pmml
new file mode 100755 (executable)
index 0000000..bd4d4e8
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+  <Header copyright="myCopyright" description="Tests unitaires">
+    <Application name="PMMLlib" version="myVersion"/>
+    <Annotation>Tests unitaires PMMLlib</Annotation>
+  </Header>
+  <DataDictionary>
+    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+  </DataDictionary>
+  <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
+    <MiningSchema>
+      <MiningField name="rw" usageType="active"/>
+      <MiningField name="r" usageType="active"/>
+      <MiningField name="tu" usageType="active"/>
+      <MiningField name="tl" usageType="active"/>
+      <MiningField name="hu" usageType="active"/>
+      <MiningField name="hl" usageType="active"/>
+      <MiningField name="l" usageType="active"/>
+      <MiningField name="kw" usageType="active"/>
+      <MiningField name="yhat" usageType="predicted"/>
+    </MiningSchema>
+    <NeuralInputs numberOfInputs="8">
+      <NeuralInput id="0">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="rw">
+            <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
+            <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="1">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="r">
+            <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
+            <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="2">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tu">
+            <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
+            <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="3">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tl">
+            <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
+            <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="4">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hu">
+            <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
+            <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="5">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hl">
+            <LinearNorm orig="0.000000e+00" norm="-4.562070e-02"/>
+            <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="6">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="l">
+            <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
+            <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="7">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="kw">
+            <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
+            <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+    </NeuralInputs>
+    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+      <Neuron id="8" bias="-1.263572e+00">
+        <Con from="0" weight="7.536629e-01"/>
+        <Con from="1" weight="1.653660e-03"/>
+        <Con from="2" weight="4.725001e-03"/>
+        <Con from="3" weight="9.969786e-03"/>
+        <Con from="4" weight="1.787976e-01"/>
+        <Con from="5" weight="-1.809809e-01"/>
+        <Con from="6" weight="-1.735688e-01"/>
+        <Con from="7" weight="8.559675e-02"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+      <Neuron id="9" bias="-1.745483e+00">
+        <Con from="8" weight="6.965512e+00"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralOutputs numberOfOutputs="1">
+      <NeuralOutput outputNeuron="9">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="yhat">
+            <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
+            <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralOutput>
+    </NeuralOutputs>
+  </NeuralNetwork>
+</PMML>
diff --git a/src/pmml/Test/samples/ann_model_2.pmml b/src/pmml/Test/samples/ann_model_2.pmml
new file mode 100755 (executable)
index 0000000..c64b4fb
--- /dev/null
@@ -0,0 +1,132 @@
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-3_0" version="3.0">
+  <Header copyright="texte copyright" description="texte description">
+    <Application name="Uranie" version="2.3/1"/>
+    <Annotation>date Fri Oct 07, 2011</Annotation>
+  </Header>
+  <DataDictionary>
+    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+  </DataDictionary>
+  <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
+    <MiningSchema>
+      <MiningField name="rw" usageType="active"/>
+      <MiningField name="r" usageType="active"/>
+      <MiningField name="tu" usageType="active"/>
+      <MiningField name="tl" usageType="active"/>
+      <MiningField name="hu" usageType="active"/>
+      <MiningField name="hl" usageType="active"/>
+      <MiningField name="l" usageType="active"/>
+      <MiningField name="kw" usageType="active"/>
+      <MiningField name="yhat" usageType="predicted"/>
+    </MiningSchema>
+    <NeuralInputs numberOfInputs="8">
+      <NeuralInput id="0">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="rw">
+            <LinearNorm orig="0" norm="-2.889932e-01"/>
+            <LinearNorm orig="9.999901e-02" norm="0"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="1">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="r">
+            <LinearNorm orig="0" norm="-5.756638e-01"/>
+            <LinearNorm orig="2.504894e+04" norm="0"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="2">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tu">
+            <LinearNorm orig="0" norm="-1.699313e-01"/>
+            <LinearNorm orig="8.933486e+04" norm="0"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="3">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tl">
+            <LinearNorm orig="0" norm="-1.707007e-01"/>
+            <LinearNorm orig="8.955232e+01" norm="0"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="4">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hu">
+            <LinearNorm orig="0" norm="-3.302777e-02"/>
+            <LinearNorm orig="1.050003e+03" norm="0"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="5">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hl">
+            <LinearNorm orig="0" norm="-4.562070e-02"/>
+            <LinearNorm orig="7.600007e+02" norm="0"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="6">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="l">
+            <LinearNorm orig="2" norm="1."/>
+            <LinearNorm orig="1.400018e+03" norm="-1."/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="7">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="kw">
+            <LinearNorm orig="0" norm="-5.780019e-02"/>
+            <LinearNorm orig="1.095001e+04" norm="0"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+    </NeuralInputs>
+    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+      <Neuron id="8" bias="-1.263572e+00">
+        <Con from="0" weight="7.536629e-01"/>
+        <Con from="1" weight="1.653660e-03"/>
+        <Con from="2" weight="4.725001e-03"/>
+        <Con from="3" weight="9.969786e-03"/>
+        <Con from="4" weight="1.787976e-01"/>
+        <Con from="5" weight="-1.809809e-01"/>
+        <Con from="6" weight="-1.735688e-01"/>
+        <Con from="7" weight="8.559675e-02"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+      <Neuron id="9" bias="-1.745483e+00">
+        <Con from="8" weight="6.965512e+00"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralOutputs numberOfOutputs="1">
+      <NeuralOutput outputNeuron="9">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="yhat">
+            <LinearNorm orig="0" norm="-5.873935e-01"/>
+            <LinearNorm orig="7.781171e+01" norm="0"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralOutput>
+      <NeuralOutput outputNeuron="-1">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="yhat">
+            <LinearNorm orig="2." norm="-1"/>
+            <LinearNorm orig="5.781171e+01" norm="1"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralOutput>
+    </NeuralOutputs>
+  </NeuralNetwork>
+</PMML>
diff --git a/src/pmml/Test/samples/lr_model.pmml b/src/pmml/Test/samples/lr_model.pmml
new file mode 100755 (executable)
index 0000000..fae9d26
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+  <Header copyright="myCopyright" description="Tests unitaires">
+    <Application name="PMMLlib" version="myVersion"/>
+    <Annotation>Tests unitaires PMMLlib</Annotation>
+  </Header>
+  <DataDictionary>
+    <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="1.100000e+01" rightMargin="2.300000e+01"/>
+    </DataField>
+    <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="2.810000e+01" rightMargin="7.670000e+01"/>
+    </DataField>
+    <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="6.360000e+00" rightMargin="1.251000e+01"/>
+    </DataField>
+  </DataDictionary>
+  <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
+    <MiningSchema>
+      <MiningField name="x6" usageType="active"/>
+      <MiningField name="x8" usageType="active"/>
+      <MiningField name="x1" usageType="predicted"/>
+    </MiningSchema>
+    <RegressionTable intercept="3.837365e+00">
+      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
+      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
+      <PredictorTerm coefficient="-2.201903e-02">
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+      <PredictorTerm coefficient="5.362560e-04">
+        <FieldRef field="x6"/>
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+    </RegressionTable>
+  </RegressionModel>
+</PMML>
diff --git a/src/pmml/Test/samples/lr_model_2.pmml b/src/pmml/Test/samples/lr_model_2.pmml
new file mode 100755 (executable)
index 0000000..2f1ef6b
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<PMML version="4.1" xmlns="http://www.dmg.org/PMML-4_1">
+  <Header copyright="myCopyright" description="Text Description">
+    <Application name="Uranie" version="2013.7/18"/>
+    <Annotation>Compilation date : Wed Jul 17, 2013</Annotation>
+  </Header>
+  <DataDictionary>
+    <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="1.100000e+01" rightMargin="2.300000e+01"/>
+    </DataField>
+    <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="2.810000e+01" rightMargin="7.670000e+01"/>
+    </DataField>
+    <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="6.360000e+00" rightMargin="1.251000e+01"/>
+    </DataField>
+  </DataDictionary>
+  <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
+    <MiningSchema>
+      <MiningField name="x6" usageType="active"/>
+      <MiningField name="x8" usageType="active"/>
+      <MiningField name="x1" usageType="predicted"/>
+    </MiningSchema>
+    <RegressionTable>
+      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
+      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
+      <PredictorTerm coefficient="-2.201903e-02">
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+      <PredictorTerm coefficient="5.362560e-04">
+        <FieldRef field="x6"/>
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+    </RegressionTable>
+  </RegressionModel>
+</PMML>
diff --git a/src/pmml/Test/samples/no_model.pmml b/src/pmml/Test/samples/no_model.pmml
new file mode 100755 (executable)
index 0000000..3951518
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+  <Header copyright="myCopyright" description="Tests unitaires">
+    <Application name="PMMLlib" version="myVersion"/>
+    <Annotation>Tests unitaires PMMLlib</Annotation>
+  </Header>
+  <DataDictionary>
+    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+  </DataDictionary>
+  <NeuralNetwork modelName="modelName" functionName="regression" numberOfLayers="2">
+    <MiningSchema>
+      <MiningField name="rw" usageType="active"/>
+      <MiningField name="r" usageType="active"/>
+      <MiningField name="tu" usageType="active"/>
+      <MiningField name="tl" usageType="active"/>
+      <MiningField name="hu" usageType="active"/>
+      <MiningField name="hl" usageType="active"/>
+      <MiningField name="l" usageType="active"/>
+      <MiningField name="kw" usageType="active"/>
+      <MiningField name="yhat" usageType="predicted"/>
+    </MiningSchema>
+    <NeuralInputs numberOfInputs="8">
+      <NeuralInput id="0">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="rw">
+            <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
+            <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="1">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="r">
+            <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
+            <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="2">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tu">
+            <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
+            <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="3">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tl">
+            <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
+            <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="4">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hu">
+            <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
+            <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="5">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hl">
+            <LineakLRAndkANNrNorm orig="0.000000e+00" norm="-4.562070e-02"/>
+            <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="6">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="l">
+            <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
+            <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="7">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="kw">
+            <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
+            <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+    </NeuralInputs>
+    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+      <Neuron id="8" bias="-1.263572e+00">
+        <Con from="0" weight="7.536629e-01"/>
+        <Con from="1" weight="1.653660e-03"/>
+        <Con from="2" weight="4.725001e-03"/>
+        <Con from="3" weight="9.969786e-03"/>
+        <Con from="4" weight="1.787976e-01"/>
+        <Con from="5" weight="-1.809809e-01"/>
+        <Con from="6" weight="-1.735688e-01"/>
+        <Con from="7" weight="8.559675e-02"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+      <Neuron id="9" bias="-1.745483e+00">
+        <Con from="8" weight="6.965512e+00"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralOutputs numberOfOutputs="1">
+      <NeuralOutput outputNeuron="9">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="yhat">
+            <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
+            <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralOutput>
+    </NeuralOutputs>
+  </NeuralNetwork>
+  <RegressionModel functionName="regression" modelName="modelName" targetFieldName="x1">
+    <MiningSchema>
+      <MiningField name="x6" usageType="active"/>
+      <MiningField name="x8" usageType="active"/>
+      <MiningField name="x1" usageType="predicted"/>
+    </MiningSchema>
+    <RegressionTable intercept="3.837365e+00">
+      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
+      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
+      <PredictorTerm coefficient="-2.201903e-02">
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+      <PredictorTerm coefficient="5.362560e-04">
+        <FieldRef field="x6"/>
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+    </RegressionTable>
+  </RegressionModel>
+</PMML>
diff --git a/src/pmml/Test/samples/two_models_ann_lr.pmml b/src/pmml/Test/samples/two_models_ann_lr.pmml
new file mode 100755 (executable)
index 0000000..3951518
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+  <Header copyright="myCopyright" description="Tests unitaires">
+    <Application name="PMMLlib" version="myVersion"/>
+    <Annotation>Tests unitaires PMMLlib</Annotation>
+  </Header>
+  <DataDictionary>
+    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+  </DataDictionary>
+  <NeuralNetwork modelName="modelName" functionName="regression" numberOfLayers="2">
+    <MiningSchema>
+      <MiningField name="rw" usageType="active"/>
+      <MiningField name="r" usageType="active"/>
+      <MiningField name="tu" usageType="active"/>
+      <MiningField name="tl" usageType="active"/>
+      <MiningField name="hu" usageType="active"/>
+      <MiningField name="hl" usageType="active"/>
+      <MiningField name="l" usageType="active"/>
+      <MiningField name="kw" usageType="active"/>
+      <MiningField name="yhat" usageType="predicted"/>
+    </MiningSchema>
+    <NeuralInputs numberOfInputs="8">
+      <NeuralInput id="0">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="rw">
+            <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
+            <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="1">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="r">
+            <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
+            <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="2">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tu">
+            <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
+            <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="3">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tl">
+            <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
+            <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="4">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hu">
+            <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
+            <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="5">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hl">
+            <LineakLRAndkANNrNorm orig="0.000000e+00" norm="-4.562070e-02"/>
+            <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="6">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="l">
+            <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
+            <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="7">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="kw">
+            <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
+            <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+    </NeuralInputs>
+    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+      <Neuron id="8" bias="-1.263572e+00">
+        <Con from="0" weight="7.536629e-01"/>
+        <Con from="1" weight="1.653660e-03"/>
+        <Con from="2" weight="4.725001e-03"/>
+        <Con from="3" weight="9.969786e-03"/>
+        <Con from="4" weight="1.787976e-01"/>
+        <Con from="5" weight="-1.809809e-01"/>
+        <Con from="6" weight="-1.735688e-01"/>
+        <Con from="7" weight="8.559675e-02"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+      <Neuron id="9" bias="-1.745483e+00">
+        <Con from="8" weight="6.965512e+00"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralOutputs numberOfOutputs="1">
+      <NeuralOutput outputNeuron="9">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="yhat">
+            <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
+            <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralOutput>
+    </NeuralOutputs>
+  </NeuralNetwork>
+  <RegressionModel functionName="regression" modelName="modelName" targetFieldName="x1">
+    <MiningSchema>
+      <MiningField name="x6" usageType="active"/>
+      <MiningField name="x8" usageType="active"/>
+      <MiningField name="x1" usageType="predicted"/>
+    </MiningSchema>
+    <RegressionTable intercept="3.837365e+00">
+      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
+      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
+      <PredictorTerm coefficient="-2.201903e-02">
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+      <PredictorTerm coefficient="5.362560e-04">
+        <FieldRef field="x6"/>
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+    </RegressionTable>
+  </RegressionModel>
+</PMML>
diff --git a/src/pmml/Test/samples/unittest_ref_ann_model.cpp b/src/pmml/Test/samples/unittest_ref_ann_model.cpp
new file mode 100755 (executable)
index 0000000..643308c
--- /dev/null
@@ -0,0 +1,67 @@
+#define ActivationFunction(sum) ( 1.0 / ( 1.0 + exp( -1.0 * sum )) )
+void myTestFunc(double *param, double *res)
+{
+  ////////////////////////////// 
+  //
+  // File used by unit test
+  // PMMLBasicsTest1::testExportNeuralNetworkCpp
+  //
+  ////////////////////////////// 
+
+  int nInput   = 8;
+  int nOutput   = 1;
+  int nHidden  = 1;
+  const int nNeurones  = 10;
+  double myTestFunc_act[nNeurones];
+
+  // --- Preprocessing of the inputs and outputs
+  double myTestFunc_minInput[] = {
+  0.099999, 25048.9, 89334.9, 89.5523, 1050, 
+  760.001, 1400.02, 10950, 
+  };
+  double myTestFunc_minOutput[] = {
+  77.8117,   };
+  double myTestFunc_maxInput[] = {
+  0.028899, 14419.8, 15180.8, 15.2866, 34.6793, 
+  34.6718, 161.826, 632.913, 
+  };
+  double myTestFunc_maxOutput[] = {
+  45.7061,   };
+
+  // --- Values of the weights
+  double myTestFunc_valW[] = {
+  -1.74548, 6.96551, -1.26357, 0.753663, 0.00165366, 
+  0.004725, 0.00996979, 0.178798, -0.180981, -0.173569, 
+  0.0855967, 
+  };
+  // --- Constants
+  int indNeurone = 0;
+  int CrtW;
+  double sum;
+
+  // --- Input Layers
+  for(int i = 0; i < nInput; i++) {
+     myTestFunc_act[indNeurone++] = ( param[i] - myTestFunc_minInput[i] ) / myTestFunc_maxInput[i];
+  }
+
+  // --- Hidden Layers
+  for (int member = 0; member < nHidden; member++) {
+     int CrtW = member * ( nInput + 2) + 2;
+     sum = myTestFunc_valW[CrtW++];
+     for (int source = 0; source < nInput; source++) {
+         sum += myTestFunc_act[source] * myTestFunc_valW[CrtW++];
+       }
+       myTestFunc_act[indNeurone++] = ActivationFunction(sum);
+  }
+
+  // --- Output
+  for (int member = 0; member < nOutput; member++) {
+    sum = myTestFunc_valW[0];
+    for (int source = 0; source < nHidden; source++) {
+      CrtW = source * ( nInput + 2) + 1;
+      sum += myTestFunc_act[nInput+source] * myTestFunc_valW[CrtW];
+    }
+    myTestFunc_act[indNeurone++] = sum;
+    res[member] = myTestFunc_minOutput[member] + myTestFunc_maxOutput[member] * sum;
+  }
+}
diff --git a/src/pmml/Test/samples/unittest_ref_ann_model.f b/src/pmml/Test/samples/unittest_ref_ann_model.f
new file mode 100755 (executable)
index 0000000..7996d31
--- /dev/null
@@ -0,0 +1,64 @@
+      SUBROUTINE myTestFunc(rw,r,tu,tl,hu,hl,l,kw,yhat)
+C --- *********************************************
+C --- 
+C ---  File used by unit test
+C ---  PMMLBasicsTest1::testExportNeuralNetworkFortran
+C --- 
+C --- *********************************************
+      IMPLICIT DOUBLE PRECISION (V)
+      DOUBLE PRECISION rw
+      DOUBLE PRECISION r
+      DOUBLE PRECISION tu
+      DOUBLE PRECISION tl
+      DOUBLE PRECISION hu
+      DOUBLE PRECISION hl
+      DOUBLE PRECISION l
+      DOUBLE PRECISION kw
+      DOUBLE PRECISION yhat
+
+C --- Preprocessing of the inputs
+      VXNrw = ( rw - 0.099999D0 ) / 0.028899D0
+      VXNr = ( r - 25048.9D0 ) / 14419.8D0
+      VXNtu = ( tu - 89334.9D0 ) / 15180.8D0
+      VXNtl = ( tl - 89.5523D0 ) / 15.2866D0
+      VXNhu = ( hu - 1050D0 ) / 34.6793D0
+      VXNhl = ( hl - 760.001D0 ) / 34.6718D0
+      VXNl = ( l - 1400.02D0 ) / 161.826D0
+      VXNkw = ( kw - 10950D0 ) / 632.913D0
+
+C --- Values of the weights
+      VW1 = -1.74548
+      VW2 = 6.96551
+      VW3 = -1.26357
+      VW4 = 0.753663
+      VW5 = 0.00165366
+      VW6 = 0.004725
+      VW7 = 0.00996979
+      VW8 = 0.178798
+      VW9 = -0.180981
+      VW10 = -0.173569
+      VW11 = 0.0855967
+
+C --- hidden neural number 1
+      VAct1 = VW3
+     1      + VW4 * VXNrw
+     1      + VW5 * VXNr
+     1      + VW6 * VXNtu
+     1      + VW7 * VXNtl
+     1      + VW8 * VXNhu
+     1      + VW9 * VXNhl
+     1      + VW10 * VXNl
+     1      + VW11 * VXNkw
+
+      VPot1 = 1.D0 / (1.D0 + DEXP(-1.D0 * VAct1))
+
+C --- Output
+      VOut = VW1
+     1    + VW2 * VPot1
+
+C --- Pretraitment of the output
+      yhat = 77.8117D0 + 45.7061D0 * VOut;
+
+C --- 
+      RETURN
+      END
diff --git a/src/pmml/Test/samples/unittest_ref_ann_model.py b/src/pmml/Test/samples/unittest_ref_ann_model.py
new file mode 100755 (executable)
index 0000000..2a1f5e5
--- /dev/null
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from math import tanh, exp
+
+def ActivationFunction(sum): 
+    return ( 1.0 / ( 1.0 + exp( -1.0 * sum ) ) ); 
+
+def myTestFunc(param):
+
+    ############################## 
+    #
+    # File used by unit test
+    # PMMLBasicsTest1::testExportNeuralNetworkPython
+    #
+    ############################## 
+
+    nInput = 8;
+    nOutput = 1;
+    nHidden = 1;
+    nNeurones = 10;
+    myTestFunc_act = [];
+    res = [];
+
+    # --- Preprocessing of the inputs and outputs
+    myTestFunc_minInput = [
+      0.099999, 25048.9, 89334.9, 89.5523, 1050, 
+    760.001, 1400.02, 10950, 
+    ];
+    myTestFunc_minOutput = [
+        77.8117
+    ];
+    myTestFunc_maxInput = [
+    0.028899, 14419.8, 15180.8, 15.2866, 34.6793, 
+    34.6718, 161.826, 632.913, 
+    ];
+    myTestFunc_maxOutput = [
+        45.7061
+    ];
+    # --- Values of the weights
+    myTestFunc_valW = [
+    -1.74548, 6.96551, -1.26357, 0.753663, 0.00165366, 
+    0.004725, 0.00996979, 0.178798, -0.180981, -0.173569, 
+    0.0855967, 
+    ];
+    # --- Constants
+    indNeurone = 0;
+
+    # --- Input Layers
+    for i in range(nInput) :
+        myTestFunc_act.append( ( param[i] - myTestFunc_minInput[i] ) / myTestFunc_maxInput[i] ) ;
+        indNeurone += 1 ;
+        pass
+
+    # --- Hidden Layers
+    for member in range(nHidden):
+        CrtW = member * ( nInput + 2) + 2;
+        sum = myTestFunc_valW[CrtW];
+        CrtW += 1 ;
+        for source in range(nInput) :
+            sum += myTestFunc_act[source] * myTestFunc_valW[CrtW];
+            CrtW += 1 ;
+            pass
+        myTestFunc_act.append( ActivationFunction(sum) ) ;
+        indNeurone += 1 ;
+        pass
+
+    # --- Output
+    for member in range(nOutput):
+        sum = myTestFunc_valW[0];
+        for source in range(nHidden):
+            CrtW = source * ( nInput + 2) + 1;
+            sum += myTestFunc_act[nInput+source] * myTestFunc_valW[CrtW];
+            pass
+        myTestFunc_act.append( sum );
+        indNeurone += 1 ;
+        res.append( myTestFunc_minOutput[member] + myTestFunc_maxOutput[member] * sum );
+        pass
+
+    return res;
+
+
diff --git a/src/pmml/Test/samples/unittest_ref_lr_model.cpp b/src/pmml/Test/samples/unittest_ref_lr_model.cpp
new file mode 100755 (executable)
index 0000000..1072f46
--- /dev/null
@@ -0,0 +1,27 @@
+void myTestFunc(double *param, double *res)
+{
+  ////////////////////////////// 
+  //
+  // File used by unit test
+  // PMMLBasicsTest1::testExportLinearRegressionCpp
+  //
+  ////////////////////////////// 
+
+  // Intercept
+  double y = 3.83737;
+
+  // Attribute : x6
+  y += param[0]*0.475913;
+
+  // Attribute : x8
+  y += param[1]*0.142884;
+
+  // Attribute : x6x8
+  y += param[2]*-0.022019;
+
+  // Attribute : x6x6x8
+  y += param[3]*0.000536256;
+
+  // Return the value
+  res[0] = y;
+}
diff --git a/src/pmml/Test/samples/unittest_ref_lr_model.f b/src/pmml/Test/samples/unittest_ref_lr_model.f
new file mode 100755 (executable)
index 0000000..7e60a97
--- /dev/null
@@ -0,0 +1,31 @@
+      SUBROUTINE myTestFunc(P0, P1, P2, P3, RES)
+C --- *********************************************
+C --- 
+C ---  File used by unit test
+C ---  PMMLBasicsTest1::testExportLinearRegressionFortran
+C --- 
+C --- *********************************************
+
+      IMPLICIT DOUBLE PRECISION (P)
+      DOUBLE PRECISION RES
+      DOUBLE PRECISION Y
+
+C --- Intercept
+      Y = 3.83737;
+
+C --- Attribute : x6
+      Y += P[0]*0.475913;
+
+C --- Attribute : x8
+      Y += P[1]*0.142884;
+
+C --- Attribute : x6x8
+      Y += P[2]*-0.022019;
+
+C --- Attribute : x6x6x8
+      Y += P[3]*0.000536256;
+
+C --- Return the value
+      RES = Y 
+      RETURN
+      END
diff --git a/src/pmml/Test/samples/unittest_ref_lr_model.py b/src/pmml/Test/samples/unittest_ref_lr_model.py
new file mode 100755 (executable)
index 0000000..5dbea2c
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+def myTestFunc(param):
+
+    ############################## 
+    # 
+    # File used by unit test
+    # PMMLBasicsTest1::testExportLinearRegressionPython
+    # 
+    ############################## 
+
+    #  Intercept
+    y = 3.83737;
+
+    #  Attribute : x6
+    y += param[0]*0.475913;
+
+    #  Attribute : x8
+    y += param[1]*0.142884;
+
+    #  Attribute : x6x8
+    y += param[2]*-0.022019;
+
+    #  Attribute : x6x6x8
+    y += param[3]*0.000536256;
+
+    #  Return the value
+    return [y];
diff --git a/src/pmml/Test/samples/win32_ann_model.pmml b/src/pmml/Test/samples/win32_ann_model.pmml
new file mode 100755 (executable)
index 0000000..ae32e3a
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+  <Header copyright="myCopyright" description="Tests unitaires">
+    <Application name="PMMLlib" version="myVersion"/>
+    <Annotation>Tests unitaires PMMLlib</Annotation>
+  </Header>
+  <DataDictionary>
+    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+  </DataDictionary>
+  <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
+    <MiningSchema>
+      <MiningField name="rw" usageType="active"/>
+      <MiningField name="r" usageType="active"/>
+      <MiningField name="tu" usageType="active"/>
+      <MiningField name="tl" usageType="active"/>
+      <MiningField name="hu" usageType="active"/>
+      <MiningField name="hl" usageType="active"/>
+      <MiningField name="l" usageType="active"/>
+      <MiningField name="kw" usageType="active"/>
+      <MiningField name="yhat" usageType="predicted"/>
+    </MiningSchema>
+    <NeuralInputs numberOfInputs="8">
+      <NeuralInput id="0">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="rw">
+            <LinearNorm orig="0.000000e+000" norm="-2.889932e-001"/>
+            <LinearNorm orig="9.999901e-002" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="1">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="r">
+            <LinearNorm orig="0.000000e+000" norm="-5.756638e-001"/>
+            <LinearNorm orig="2.504894e+004" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="2">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tu">
+            <LinearNorm orig="0.000000e+000" norm="-1.699313e-001"/>
+            <LinearNorm orig="8.933486e+004" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="3">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="tl">
+            <LinearNorm orig="0.000000e+000" norm="-1.707007e-001"/>
+            <LinearNorm orig="8.955232e+001" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="4">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hu">
+            <LinearNorm orig="0.000000e+000" norm="-3.302777e-002"/>
+            <LinearNorm orig="1.050003e+003" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="5">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="hl">
+            <LinearNorm orig="0.000000e+000" norm="-4.562070e-002"/>
+            <LinearNorm orig="7.600007e+002" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="6">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="l">
+            <LinearNorm orig="0.000000e+000" norm="-1.155882e-001"/>
+            <LinearNorm orig="1.400018e+003" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+      <NeuralInput id="7">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="kw">
+            <LinearNorm orig="0.000000e+000" norm="-5.780019e-002"/>
+            <LinearNorm orig="1.095001e+004" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralInput>
+    </NeuralInputs>
+    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+      <Neuron id="8" bias="-1.263572e+000">
+        <Con from="0" weight="7.536629e-001"/>
+        <Con from="1" weight="1.653660e-003"/>
+        <Con from="2" weight="4.725001e-003"/>
+        <Con from="3" weight="9.969786e-003"/>
+        <Con from="4" weight="1.787976e-001"/>
+        <Con from="5" weight="-1.809809e-001"/>
+        <Con from="6" weight="-1.735688e-001"/>
+        <Con from="7" weight="8.559675e-002"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+      <Neuron id="9" bias="-1.745483e+000">
+        <Con from="8" weight="6.965512e+000"/>
+      </Neuron>
+    </NeuralLayer>
+    <NeuralOutputs numberOfOutputs="1">
+      <NeuralOutput outputNeuron="9">
+        <DerivedField optype="continuous" dataType="float">
+          <NormContinuous field="yhat">
+            <LinearNorm orig="0.000000e+000" norm="-5.873935e-001"/>
+            <LinearNorm orig="7.781171e+001" norm="0.000000e+000"/>
+          </NormContinuous>
+        </DerivedField>
+      </NeuralOutput>
+    </NeuralOutputs>
+  </NeuralNetwork>
+</PMML>
diff --git a/src/pmml/Test/samples/win32_lr_model.pmml b/src/pmml/Test/samples/win32_lr_model.pmml
new file mode 100755 (executable)
index 0000000..afc0b14
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+  <Header copyright="myCopyright" description="Tests unitaires">
+    <Application name="PMMLlib" version="myVersion"/>
+    <Annotation>Tests unitaires PMMLlib</Annotation>
+  </Header>
+  <DataDictionary>
+    <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="1.100000e+001" rightMargin="2.300000e+001"/>
+    </DataField>
+    <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="2.810000e+001" rightMargin="7.670000e+001"/>
+    </DataField>
+    <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
+      <Interval closure="ClosedClosed" leftMargin="6.360000e+000" rightMargin="1.251000e+001"/>
+    </DataField>
+  </DataDictionary>
+  <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
+    <MiningSchema>
+      <MiningField name="x6" usageType="active"/>
+      <MiningField name="x8" usageType="active"/>
+      <MiningField name="x1" usageType="predicted"/>
+    </MiningSchema>
+    <RegressionTable intercept="3.837365e+000">
+      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-001"/>
+      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-001"/>
+      <PredictorTerm coefficient="-2.201903e-002">
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+      <PredictorTerm coefficient="5.362560e-004">
+        <FieldRef field="x6"/>
+        <FieldRef field="x6"/>
+        <FieldRef field="x8"/>
+      </PredictorTerm>
+    </RegressionTable>
+  </RegressionModel>
+</PMML>
index 59a4a180b653a5ed9706ac88b39ce0150b0f4b78..a7c17a36f28ee870bf84a28640bd184122436abf 100755 (executable)
@@ -13,12 +13,10 @@ import shutil
 class PMMLBasicsTest(unittest.TestCase):
 
     def setUp(self):
-        pmmlRootDir = os.getenv("YACS_ROOT_DIR");
-        self.resourcesDir = os.path.join(pmmlRootDir,"share","salome","resources","pmml");
-        self.resourcesDir += os.sep ;
-        self.tmpDir = "/tmp/";
-        self.tmpDir += os.environ['LOGNAME']; # ("USER");
-        self.tmpDir += "/PmmlUnitTest/";
+        self.resourcesDir = ".." + os.sep + "Test" + os.sep + "samples" + os.sep ;
+        self.tmpDir = os.sep + "tmp" + os.sep + os.environ['LOGNAME'] + os.sep ;
+        self.tmpDir += "PmmlUnitTest";
+        self.tmpDir += os.sep ;
         if ( not os.path.exists(self.tmpDir) ):
             os.mkdir(self.tmpDir);
             pass
diff --git a/src/pmml/resources/CMakeLists.txt b/src/pmml/resources/CMakeLists.txt
deleted file mode 100755 (executable)
index 68c41e5..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-SET(PMML_RESOURCES_FILES
-  # ici les noms des fichiers ressources 
-  ann_model.pmml
-  ann_model_2.pmml
-  lr_model.pmml
-  lr_model_2.pmml
-  no_model.pmml
-  two_models_ann_lr.pmml
-  unittest_ref_ann_model.cpp
-  unittest_ref_ann_model.f
-  unittest_ref_ann_model.py
-  unittest_ref_lr_model.cpp
-  unittest_ref_lr_model.f
-  unittest_ref_lr_model.py
-  win32_ann_model.pmml
-  win32_lr_model.pmml 
-  )
-
-INSTALL(FILES ${PMML_RESOURCES_FILES} DESTINATION ${SALOME_PMML_INSTALL_RES_DATA})
-
-# MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml")
-# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/PMMLCatalog.xml.in ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml @ONLY)
-# MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml")
-# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml @ONLY)
-
-# INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${SALOME_PMML_INSTALL_RES_DATA})
diff --git a/src/pmml/resources/ann_model.pmml b/src/pmml/resources/ann_model.pmml
deleted file mode 100755 (executable)
index bd4d4e8..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
-  <Header copyright="myCopyright" description="Tests unitaires">
-    <Application name="PMMLlib" version="myVersion"/>
-    <Annotation>Tests unitaires PMMLlib</Annotation>
-  </Header>
-  <DataDictionary>
-    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
-    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
-    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
-    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
-    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
-    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
-    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
-    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
-    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
-  </DataDictionary>
-  <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
-    <MiningSchema>
-      <MiningField name="rw" usageType="active"/>
-      <MiningField name="r" usageType="active"/>
-      <MiningField name="tu" usageType="active"/>
-      <MiningField name="tl" usageType="active"/>
-      <MiningField name="hu" usageType="active"/>
-      <MiningField name="hl" usageType="active"/>
-      <MiningField name="l" usageType="active"/>
-      <MiningField name="kw" usageType="active"/>
-      <MiningField name="yhat" usageType="predicted"/>
-    </MiningSchema>
-    <NeuralInputs numberOfInputs="8">
-      <NeuralInput id="0">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="rw">
-            <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
-            <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="1">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="r">
-            <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
-            <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="2">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tu">
-            <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
-            <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="3">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tl">
-            <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
-            <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="4">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hu">
-            <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
-            <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="5">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hl">
-            <LinearNorm orig="0.000000e+00" norm="-4.562070e-02"/>
-            <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="6">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="l">
-            <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
-            <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="7">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="kw">
-            <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
-            <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-    </NeuralInputs>
-    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
-      <Neuron id="8" bias="-1.263572e+00">
-        <Con from="0" weight="7.536629e-01"/>
-        <Con from="1" weight="1.653660e-03"/>
-        <Con from="2" weight="4.725001e-03"/>
-        <Con from="3" weight="9.969786e-03"/>
-        <Con from="4" weight="1.787976e-01"/>
-        <Con from="5" weight="-1.809809e-01"/>
-        <Con from="6" weight="-1.735688e-01"/>
-        <Con from="7" weight="8.559675e-02"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
-      <Neuron id="9" bias="-1.745483e+00">
-        <Con from="8" weight="6.965512e+00"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralOutputs numberOfOutputs="1">
-      <NeuralOutput outputNeuron="9">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="yhat">
-            <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
-            <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralOutput>
-    </NeuralOutputs>
-  </NeuralNetwork>
-</PMML>
diff --git a/src/pmml/resources/ann_model_2.pmml b/src/pmml/resources/ann_model_2.pmml
deleted file mode 100755 (executable)
index c64b4fb..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-3_0" version="3.0">
-  <Header copyright="texte copyright" description="texte description">
-    <Application name="Uranie" version="2.3/1"/>
-    <Annotation>date Fri Oct 07, 2011</Annotation>
-  </Header>
-  <DataDictionary>
-    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
-    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
-    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
-    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
-    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
-    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
-    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
-    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
-    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
-  </DataDictionary>
-  <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
-    <MiningSchema>
-      <MiningField name="rw" usageType="active"/>
-      <MiningField name="r" usageType="active"/>
-      <MiningField name="tu" usageType="active"/>
-      <MiningField name="tl" usageType="active"/>
-      <MiningField name="hu" usageType="active"/>
-      <MiningField name="hl" usageType="active"/>
-      <MiningField name="l" usageType="active"/>
-      <MiningField name="kw" usageType="active"/>
-      <MiningField name="yhat" usageType="predicted"/>
-    </MiningSchema>
-    <NeuralInputs numberOfInputs="8">
-      <NeuralInput id="0">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="rw">
-            <LinearNorm orig="0" norm="-2.889932e-01"/>
-            <LinearNorm orig="9.999901e-02" norm="0"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="1">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="r">
-            <LinearNorm orig="0" norm="-5.756638e-01"/>
-            <LinearNorm orig="2.504894e+04" norm="0"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="2">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tu">
-            <LinearNorm orig="0" norm="-1.699313e-01"/>
-            <LinearNorm orig="8.933486e+04" norm="0"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="3">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tl">
-            <LinearNorm orig="0" norm="-1.707007e-01"/>
-            <LinearNorm orig="8.955232e+01" norm="0"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="4">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hu">
-            <LinearNorm orig="0" norm="-3.302777e-02"/>
-            <LinearNorm orig="1.050003e+03" norm="0"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="5">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hl">
-            <LinearNorm orig="0" norm="-4.562070e-02"/>
-            <LinearNorm orig="7.600007e+02" norm="0"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="6">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="l">
-            <LinearNorm orig="2" norm="1."/>
-            <LinearNorm orig="1.400018e+03" norm="-1."/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="7">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="kw">
-            <LinearNorm orig="0" norm="-5.780019e-02"/>
-            <LinearNorm orig="1.095001e+04" norm="0"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-    </NeuralInputs>
-    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
-      <Neuron id="8" bias="-1.263572e+00">
-        <Con from="0" weight="7.536629e-01"/>
-        <Con from="1" weight="1.653660e-03"/>
-        <Con from="2" weight="4.725001e-03"/>
-        <Con from="3" weight="9.969786e-03"/>
-        <Con from="4" weight="1.787976e-01"/>
-        <Con from="5" weight="-1.809809e-01"/>
-        <Con from="6" weight="-1.735688e-01"/>
-        <Con from="7" weight="8.559675e-02"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
-      <Neuron id="9" bias="-1.745483e+00">
-        <Con from="8" weight="6.965512e+00"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralOutputs numberOfOutputs="1">
-      <NeuralOutput outputNeuron="9">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="yhat">
-            <LinearNorm orig="0" norm="-5.873935e-01"/>
-            <LinearNorm orig="7.781171e+01" norm="0"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralOutput>
-      <NeuralOutput outputNeuron="-1">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="yhat">
-            <LinearNorm orig="2." norm="-1"/>
-            <LinearNorm orig="5.781171e+01" norm="1"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralOutput>
-    </NeuralOutputs>
-  </NeuralNetwork>
-</PMML>
diff --git a/src/pmml/resources/lr_model.pmml b/src/pmml/resources/lr_model.pmml
deleted file mode 100755 (executable)
index fae9d26..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
-  <Header copyright="myCopyright" description="Tests unitaires">
-    <Application name="PMMLlib" version="myVersion"/>
-    <Annotation>Tests unitaires PMMLlib</Annotation>
-  </Header>
-  <DataDictionary>
-    <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="1.100000e+01" rightMargin="2.300000e+01"/>
-    </DataField>
-    <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="2.810000e+01" rightMargin="7.670000e+01"/>
-    </DataField>
-    <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="6.360000e+00" rightMargin="1.251000e+01"/>
-    </DataField>
-  </DataDictionary>
-  <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
-    <MiningSchema>
-      <MiningField name="x6" usageType="active"/>
-      <MiningField name="x8" usageType="active"/>
-      <MiningField name="x1" usageType="predicted"/>
-    </MiningSchema>
-    <RegressionTable intercept="3.837365e+00">
-      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
-      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
-      <PredictorTerm coefficient="-2.201903e-02">
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-      <PredictorTerm coefficient="5.362560e-04">
-        <FieldRef field="x6"/>
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-    </RegressionTable>
-  </RegressionModel>
-</PMML>
diff --git a/src/pmml/resources/lr_model_2.pmml b/src/pmml/resources/lr_model_2.pmml
deleted file mode 100755 (executable)
index 2f1ef6b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<PMML version="4.1" xmlns="http://www.dmg.org/PMML-4_1">
-  <Header copyright="myCopyright" description="Text Description">
-    <Application name="Uranie" version="2013.7/18"/>
-    <Annotation>Compilation date : Wed Jul 17, 2013</Annotation>
-  </Header>
-  <DataDictionary>
-    <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="1.100000e+01" rightMargin="2.300000e+01"/>
-    </DataField>
-    <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="2.810000e+01" rightMargin="7.670000e+01"/>
-    </DataField>
-    <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="6.360000e+00" rightMargin="1.251000e+01"/>
-    </DataField>
-  </DataDictionary>
-  <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
-    <MiningSchema>
-      <MiningField name="x6" usageType="active"/>
-      <MiningField name="x8" usageType="active"/>
-      <MiningField name="x1" usageType="predicted"/>
-    </MiningSchema>
-    <RegressionTable>
-      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
-      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
-      <PredictorTerm coefficient="-2.201903e-02">
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-      <PredictorTerm coefficient="5.362560e-04">
-        <FieldRef field="x6"/>
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-    </RegressionTable>
-  </RegressionModel>
-</PMML>
diff --git a/src/pmml/resources/no_model.pmml b/src/pmml/resources/no_model.pmml
deleted file mode 100755 (executable)
index 3951518..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
-  <Header copyright="myCopyright" description="Tests unitaires">
-    <Application name="PMMLlib" version="myVersion"/>
-    <Annotation>Tests unitaires PMMLlib</Annotation>
-  </Header>
-  <DataDictionary>
-    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
-    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
-    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
-    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
-    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
-    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
-    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
-    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
-    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
-  </DataDictionary>
-  <NeuralNetwork modelName="modelName" functionName="regression" numberOfLayers="2">
-    <MiningSchema>
-      <MiningField name="rw" usageType="active"/>
-      <MiningField name="r" usageType="active"/>
-      <MiningField name="tu" usageType="active"/>
-      <MiningField name="tl" usageType="active"/>
-      <MiningField name="hu" usageType="active"/>
-      <MiningField name="hl" usageType="active"/>
-      <MiningField name="l" usageType="active"/>
-      <MiningField name="kw" usageType="active"/>
-      <MiningField name="yhat" usageType="predicted"/>
-    </MiningSchema>
-    <NeuralInputs numberOfInputs="8">
-      <NeuralInput id="0">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="rw">
-            <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
-            <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="1">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="r">
-            <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
-            <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="2">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tu">
-            <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
-            <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="3">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tl">
-            <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
-            <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="4">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hu">
-            <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
-            <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="5">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hl">
-            <LineakLRAndkANNrNorm orig="0.000000e+00" norm="-4.562070e-02"/>
-            <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="6">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="l">
-            <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
-            <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="7">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="kw">
-            <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
-            <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-    </NeuralInputs>
-    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
-      <Neuron id="8" bias="-1.263572e+00">
-        <Con from="0" weight="7.536629e-01"/>
-        <Con from="1" weight="1.653660e-03"/>
-        <Con from="2" weight="4.725001e-03"/>
-        <Con from="3" weight="9.969786e-03"/>
-        <Con from="4" weight="1.787976e-01"/>
-        <Con from="5" weight="-1.809809e-01"/>
-        <Con from="6" weight="-1.735688e-01"/>
-        <Con from="7" weight="8.559675e-02"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
-      <Neuron id="9" bias="-1.745483e+00">
-        <Con from="8" weight="6.965512e+00"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralOutputs numberOfOutputs="1">
-      <NeuralOutput outputNeuron="9">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="yhat">
-            <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
-            <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralOutput>
-    </NeuralOutputs>
-  </NeuralNetwork>
-  <RegressionModel functionName="regression" modelName="modelName" targetFieldName="x1">
-    <MiningSchema>
-      <MiningField name="x6" usageType="active"/>
-      <MiningField name="x8" usageType="active"/>
-      <MiningField name="x1" usageType="predicted"/>
-    </MiningSchema>
-    <RegressionTable intercept="3.837365e+00">
-      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
-      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
-      <PredictorTerm coefficient="-2.201903e-02">
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-      <PredictorTerm coefficient="5.362560e-04">
-        <FieldRef field="x6"/>
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-    </RegressionTable>
-  </RegressionModel>
-</PMML>
diff --git a/src/pmml/resources/two_models_ann_lr.pmml b/src/pmml/resources/two_models_ann_lr.pmml
deleted file mode 100755 (executable)
index 3951518..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
-  <Header copyright="myCopyright" description="Tests unitaires">
-    <Application name="PMMLlib" version="myVersion"/>
-    <Annotation>Tests unitaires PMMLlib</Annotation>
-  </Header>
-  <DataDictionary>
-    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
-    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
-    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
-    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
-    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
-    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
-    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
-    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
-    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
-  </DataDictionary>
-  <NeuralNetwork modelName="modelName" functionName="regression" numberOfLayers="2">
-    <MiningSchema>
-      <MiningField name="rw" usageType="active"/>
-      <MiningField name="r" usageType="active"/>
-      <MiningField name="tu" usageType="active"/>
-      <MiningField name="tl" usageType="active"/>
-      <MiningField name="hu" usageType="active"/>
-      <MiningField name="hl" usageType="active"/>
-      <MiningField name="l" usageType="active"/>
-      <MiningField name="kw" usageType="active"/>
-      <MiningField name="yhat" usageType="predicted"/>
-    </MiningSchema>
-    <NeuralInputs numberOfInputs="8">
-      <NeuralInput id="0">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="rw">
-            <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
-            <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="1">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="r">
-            <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
-            <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="2">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tu">
-            <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
-            <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="3">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tl">
-            <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
-            <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="4">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hu">
-            <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
-            <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="5">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hl">
-            <LineakLRAndkANNrNorm orig="0.000000e+00" norm="-4.562070e-02"/>
-            <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="6">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="l">
-            <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
-            <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="7">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="kw">
-            <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
-            <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-    </NeuralInputs>
-    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
-      <Neuron id="8" bias="-1.263572e+00">
-        <Con from="0" weight="7.536629e-01"/>
-        <Con from="1" weight="1.653660e-03"/>
-        <Con from="2" weight="4.725001e-03"/>
-        <Con from="3" weight="9.969786e-03"/>
-        <Con from="4" weight="1.787976e-01"/>
-        <Con from="5" weight="-1.809809e-01"/>
-        <Con from="6" weight="-1.735688e-01"/>
-        <Con from="7" weight="8.559675e-02"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
-      <Neuron id="9" bias="-1.745483e+00">
-        <Con from="8" weight="6.965512e+00"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralOutputs numberOfOutputs="1">
-      <NeuralOutput outputNeuron="9">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="yhat">
-            <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
-            <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralOutput>
-    </NeuralOutputs>
-  </NeuralNetwork>
-  <RegressionModel functionName="regression" modelName="modelName" targetFieldName="x1">
-    <MiningSchema>
-      <MiningField name="x6" usageType="active"/>
-      <MiningField name="x8" usageType="active"/>
-      <MiningField name="x1" usageType="predicted"/>
-    </MiningSchema>
-    <RegressionTable intercept="3.837365e+00">
-      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
-      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
-      <PredictorTerm coefficient="-2.201903e-02">
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-      <PredictorTerm coefficient="5.362560e-04">
-        <FieldRef field="x6"/>
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-    </RegressionTable>
-  </RegressionModel>
-</PMML>
diff --git a/src/pmml/resources/unittest_ref_ann_model.cpp b/src/pmml/resources/unittest_ref_ann_model.cpp
deleted file mode 100755 (executable)
index 643308c..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#define ActivationFunction(sum) ( 1.0 / ( 1.0 + exp( -1.0 * sum )) )
-void myTestFunc(double *param, double *res)
-{
-  ////////////////////////////// 
-  //
-  // File used by unit test
-  // PMMLBasicsTest1::testExportNeuralNetworkCpp
-  //
-  ////////////////////////////// 
-
-  int nInput   = 8;
-  int nOutput   = 1;
-  int nHidden  = 1;
-  const int nNeurones  = 10;
-  double myTestFunc_act[nNeurones];
-
-  // --- Preprocessing of the inputs and outputs
-  double myTestFunc_minInput[] = {
-  0.099999, 25048.9, 89334.9, 89.5523, 1050, 
-  760.001, 1400.02, 10950, 
-  };
-  double myTestFunc_minOutput[] = {
-  77.8117,   };
-  double myTestFunc_maxInput[] = {
-  0.028899, 14419.8, 15180.8, 15.2866, 34.6793, 
-  34.6718, 161.826, 632.913, 
-  };
-  double myTestFunc_maxOutput[] = {
-  45.7061,   };
-
-  // --- Values of the weights
-  double myTestFunc_valW[] = {
-  -1.74548, 6.96551, -1.26357, 0.753663, 0.00165366, 
-  0.004725, 0.00996979, 0.178798, -0.180981, -0.173569, 
-  0.0855967, 
-  };
-  // --- Constants
-  int indNeurone = 0;
-  int CrtW;
-  double sum;
-
-  // --- Input Layers
-  for(int i = 0; i < nInput; i++) {
-     myTestFunc_act[indNeurone++] = ( param[i] - myTestFunc_minInput[i] ) / myTestFunc_maxInput[i];
-  }
-
-  // --- Hidden Layers
-  for (int member = 0; member < nHidden; member++) {
-     int CrtW = member * ( nInput + 2) + 2;
-     sum = myTestFunc_valW[CrtW++];
-     for (int source = 0; source < nInput; source++) {
-         sum += myTestFunc_act[source] * myTestFunc_valW[CrtW++];
-       }
-       myTestFunc_act[indNeurone++] = ActivationFunction(sum);
-  }
-
-  // --- Output
-  for (int member = 0; member < nOutput; member++) {
-    sum = myTestFunc_valW[0];
-    for (int source = 0; source < nHidden; source++) {
-      CrtW = source * ( nInput + 2) + 1;
-      sum += myTestFunc_act[nInput+source] * myTestFunc_valW[CrtW];
-    }
-    myTestFunc_act[indNeurone++] = sum;
-    res[member] = myTestFunc_minOutput[member] + myTestFunc_maxOutput[member] * sum;
-  }
-}
diff --git a/src/pmml/resources/unittest_ref_ann_model.f b/src/pmml/resources/unittest_ref_ann_model.f
deleted file mode 100755 (executable)
index 7996d31..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-      SUBROUTINE myTestFunc(rw,r,tu,tl,hu,hl,l,kw,yhat)
-C --- *********************************************
-C --- 
-C ---  File used by unit test
-C ---  PMMLBasicsTest1::testExportNeuralNetworkFortran
-C --- 
-C --- *********************************************
-      IMPLICIT DOUBLE PRECISION (V)
-      DOUBLE PRECISION rw
-      DOUBLE PRECISION r
-      DOUBLE PRECISION tu
-      DOUBLE PRECISION tl
-      DOUBLE PRECISION hu
-      DOUBLE PRECISION hl
-      DOUBLE PRECISION l
-      DOUBLE PRECISION kw
-      DOUBLE PRECISION yhat
-
-C --- Preprocessing of the inputs
-      VXNrw = ( rw - 0.099999D0 ) / 0.028899D0
-      VXNr = ( r - 25048.9D0 ) / 14419.8D0
-      VXNtu = ( tu - 89334.9D0 ) / 15180.8D0
-      VXNtl = ( tl - 89.5523D0 ) / 15.2866D0
-      VXNhu = ( hu - 1050D0 ) / 34.6793D0
-      VXNhl = ( hl - 760.001D0 ) / 34.6718D0
-      VXNl = ( l - 1400.02D0 ) / 161.826D0
-      VXNkw = ( kw - 10950D0 ) / 632.913D0
-
-C --- Values of the weights
-      VW1 = -1.74548
-      VW2 = 6.96551
-      VW3 = -1.26357
-      VW4 = 0.753663
-      VW5 = 0.00165366
-      VW6 = 0.004725
-      VW7 = 0.00996979
-      VW8 = 0.178798
-      VW9 = -0.180981
-      VW10 = -0.173569
-      VW11 = 0.0855967
-
-C --- hidden neural number 1
-      VAct1 = VW3
-     1      + VW4 * VXNrw
-     1      + VW5 * VXNr
-     1      + VW6 * VXNtu
-     1      + VW7 * VXNtl
-     1      + VW8 * VXNhu
-     1      + VW9 * VXNhl
-     1      + VW10 * VXNl
-     1      + VW11 * VXNkw
-
-      VPot1 = 1.D0 / (1.D0 + DEXP(-1.D0 * VAct1))
-
-C --- Output
-      VOut = VW1
-     1    + VW2 * VPot1
-
-C --- Pretraitment of the output
-      yhat = 77.8117D0 + 45.7061D0 * VOut;
-
-C --- 
-      RETURN
-      END
diff --git a/src/pmml/resources/unittest_ref_ann_model.py b/src/pmml/resources/unittest_ref_ann_model.py
deleted file mode 100755 (executable)
index 2a1f5e5..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-from math import tanh, exp
-
-def ActivationFunction(sum): 
-    return ( 1.0 / ( 1.0 + exp( -1.0 * sum ) ) ); 
-
-def myTestFunc(param):
-
-    ############################## 
-    #
-    # File used by unit test
-    # PMMLBasicsTest1::testExportNeuralNetworkPython
-    #
-    ############################## 
-
-    nInput = 8;
-    nOutput = 1;
-    nHidden = 1;
-    nNeurones = 10;
-    myTestFunc_act = [];
-    res = [];
-
-    # --- Preprocessing of the inputs and outputs
-    myTestFunc_minInput = [
-      0.099999, 25048.9, 89334.9, 89.5523, 1050, 
-    760.001, 1400.02, 10950, 
-    ];
-    myTestFunc_minOutput = [
-        77.8117
-    ];
-    myTestFunc_maxInput = [
-    0.028899, 14419.8, 15180.8, 15.2866, 34.6793, 
-    34.6718, 161.826, 632.913, 
-    ];
-    myTestFunc_maxOutput = [
-        45.7061
-    ];
-    # --- Values of the weights
-    myTestFunc_valW = [
-    -1.74548, 6.96551, -1.26357, 0.753663, 0.00165366, 
-    0.004725, 0.00996979, 0.178798, -0.180981, -0.173569, 
-    0.0855967, 
-    ];
-    # --- Constants
-    indNeurone = 0;
-
-    # --- Input Layers
-    for i in range(nInput) :
-        myTestFunc_act.append( ( param[i] - myTestFunc_minInput[i] ) / myTestFunc_maxInput[i] ) ;
-        indNeurone += 1 ;
-        pass
-
-    # --- Hidden Layers
-    for member in range(nHidden):
-        CrtW = member * ( nInput + 2) + 2;
-        sum = myTestFunc_valW[CrtW];
-        CrtW += 1 ;
-        for source in range(nInput) :
-            sum += myTestFunc_act[source] * myTestFunc_valW[CrtW];
-            CrtW += 1 ;
-            pass
-        myTestFunc_act.append( ActivationFunction(sum) ) ;
-        indNeurone += 1 ;
-        pass
-
-    # --- Output
-    for member in range(nOutput):
-        sum = myTestFunc_valW[0];
-        for source in range(nHidden):
-            CrtW = source * ( nInput + 2) + 1;
-            sum += myTestFunc_act[nInput+source] * myTestFunc_valW[CrtW];
-            pass
-        myTestFunc_act.append( sum );
-        indNeurone += 1 ;
-        res.append( myTestFunc_minOutput[member] + myTestFunc_maxOutput[member] * sum );
-        pass
-
-    return res;
-
-
diff --git a/src/pmml/resources/unittest_ref_lr_model.cpp b/src/pmml/resources/unittest_ref_lr_model.cpp
deleted file mode 100755 (executable)
index 1072f46..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-void myTestFunc(double *param, double *res)
-{
-  ////////////////////////////// 
-  //
-  // File used by unit test
-  // PMMLBasicsTest1::testExportLinearRegressionCpp
-  //
-  ////////////////////////////// 
-
-  // Intercept
-  double y = 3.83737;
-
-  // Attribute : x6
-  y += param[0]*0.475913;
-
-  // Attribute : x8
-  y += param[1]*0.142884;
-
-  // Attribute : x6x8
-  y += param[2]*-0.022019;
-
-  // Attribute : x6x6x8
-  y += param[3]*0.000536256;
-
-  // Return the value
-  res[0] = y;
-}
diff --git a/src/pmml/resources/unittest_ref_lr_model.f b/src/pmml/resources/unittest_ref_lr_model.f
deleted file mode 100755 (executable)
index 7e60a97..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-      SUBROUTINE myTestFunc(P0, P1, P2, P3, RES)
-C --- *********************************************
-C --- 
-C ---  File used by unit test
-C ---  PMMLBasicsTest1::testExportLinearRegressionFortran
-C --- 
-C --- *********************************************
-
-      IMPLICIT DOUBLE PRECISION (P)
-      DOUBLE PRECISION RES
-      DOUBLE PRECISION Y
-
-C --- Intercept
-      Y = 3.83737;
-
-C --- Attribute : x6
-      Y += P[0]*0.475913;
-
-C --- Attribute : x8
-      Y += P[1]*0.142884;
-
-C --- Attribute : x6x8
-      Y += P[2]*-0.022019;
-
-C --- Attribute : x6x6x8
-      Y += P[3]*0.000536256;
-
-C --- Return the value
-      RES = Y 
-      RETURN
-      END
diff --git a/src/pmml/resources/unittest_ref_lr_model.py b/src/pmml/resources/unittest_ref_lr_model.py
deleted file mode 100755 (executable)
index 5dbea2c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-def myTestFunc(param):
-
-    ############################## 
-    # 
-    # File used by unit test
-    # PMMLBasicsTest1::testExportLinearRegressionPython
-    # 
-    ############################## 
-
-    #  Intercept
-    y = 3.83737;
-
-    #  Attribute : x6
-    y += param[0]*0.475913;
-
-    #  Attribute : x8
-    y += param[1]*0.142884;
-
-    #  Attribute : x6x8
-    y += param[2]*-0.022019;
-
-    #  Attribute : x6x6x8
-    y += param[3]*0.000536256;
-
-    #  Return the value
-    return [y];
diff --git a/src/pmml/resources/win32_ann_model.pmml b/src/pmml/resources/win32_ann_model.pmml
deleted file mode 100755 (executable)
index ae32e3a..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
-  <Header copyright="myCopyright" description="Tests unitaires">
-    <Application name="PMMLlib" version="myVersion"/>
-    <Annotation>Tests unitaires PMMLlib</Annotation>
-  </Header>
-  <DataDictionary>
-    <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
-    <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
-    <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
-    <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
-    <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
-    <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
-    <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
-    <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
-    <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
-  </DataDictionary>
-  <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
-    <MiningSchema>
-      <MiningField name="rw" usageType="active"/>
-      <MiningField name="r" usageType="active"/>
-      <MiningField name="tu" usageType="active"/>
-      <MiningField name="tl" usageType="active"/>
-      <MiningField name="hu" usageType="active"/>
-      <MiningField name="hl" usageType="active"/>
-      <MiningField name="l" usageType="active"/>
-      <MiningField name="kw" usageType="active"/>
-      <MiningField name="yhat" usageType="predicted"/>
-    </MiningSchema>
-    <NeuralInputs numberOfInputs="8">
-      <NeuralInput id="0">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="rw">
-            <LinearNorm orig="0.000000e+000" norm="-2.889932e-001"/>
-            <LinearNorm orig="9.999901e-002" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="1">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="r">
-            <LinearNorm orig="0.000000e+000" norm="-5.756638e-001"/>
-            <LinearNorm orig="2.504894e+004" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="2">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tu">
-            <LinearNorm orig="0.000000e+000" norm="-1.699313e-001"/>
-            <LinearNorm orig="8.933486e+004" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="3">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="tl">
-            <LinearNorm orig="0.000000e+000" norm="-1.707007e-001"/>
-            <LinearNorm orig="8.955232e+001" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="4">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hu">
-            <LinearNorm orig="0.000000e+000" norm="-3.302777e-002"/>
-            <LinearNorm orig="1.050003e+003" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="5">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="hl">
-            <LinearNorm orig="0.000000e+000" norm="-4.562070e-002"/>
-            <LinearNorm orig="7.600007e+002" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="6">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="l">
-            <LinearNorm orig="0.000000e+000" norm="-1.155882e-001"/>
-            <LinearNorm orig="1.400018e+003" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-      <NeuralInput id="7">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="kw">
-            <LinearNorm orig="0.000000e+000" norm="-5.780019e-002"/>
-            <LinearNorm orig="1.095001e+004" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralInput>
-    </NeuralInputs>
-    <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
-      <Neuron id="8" bias="-1.263572e+000">
-        <Con from="0" weight="7.536629e-001"/>
-        <Con from="1" weight="1.653660e-003"/>
-        <Con from="2" weight="4.725001e-003"/>
-        <Con from="3" weight="9.969786e-003"/>
-        <Con from="4" weight="1.787976e-001"/>
-        <Con from="5" weight="-1.809809e-001"/>
-        <Con from="6" weight="-1.735688e-001"/>
-        <Con from="7" weight="8.559675e-002"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralLayer activationFunction="identity" numberOfNeurons="1">
-      <Neuron id="9" bias="-1.745483e+000">
-        <Con from="8" weight="6.965512e+000"/>
-      </Neuron>
-    </NeuralLayer>
-    <NeuralOutputs numberOfOutputs="1">
-      <NeuralOutput outputNeuron="9">
-        <DerivedField optype="continuous" dataType="float">
-          <NormContinuous field="yhat">
-            <LinearNorm orig="0.000000e+000" norm="-5.873935e-001"/>
-            <LinearNorm orig="7.781171e+001" norm="0.000000e+000"/>
-          </NormContinuous>
-        </DerivedField>
-      </NeuralOutput>
-    </NeuralOutputs>
-  </NeuralNetwork>
-</PMML>
diff --git a/src/pmml/resources/win32_lr_model.pmml b/src/pmml/resources/win32_lr_model.pmml
deleted file mode 100755 (executable)
index afc0b14..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
-  <Header copyright="myCopyright" description="Tests unitaires">
-    <Application name="PMMLlib" version="myVersion"/>
-    <Annotation>Tests unitaires PMMLlib</Annotation>
-  </Header>
-  <DataDictionary>
-    <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="1.100000e+001" rightMargin="2.300000e+001"/>
-    </DataField>
-    <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="2.810000e+001" rightMargin="7.670000e+001"/>
-    </DataField>
-    <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
-      <Interval closure="ClosedClosed" leftMargin="6.360000e+000" rightMargin="1.251000e+001"/>
-    </DataField>
-  </DataDictionary>
-  <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
-    <MiningSchema>
-      <MiningField name="x6" usageType="active"/>
-      <MiningField name="x8" usageType="active"/>
-      <MiningField name="x1" usageType="predicted"/>
-    </MiningSchema>
-    <RegressionTable intercept="3.837365e+000">
-      <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-001"/>
-      <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-001"/>
-      <PredictorTerm coefficient="-2.201903e-002">
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-      <PredictorTerm coefficient="5.362560e-004">
-        <FieldRef field="x6"/>
-        <FieldRef field="x6"/>
-        <FieldRef field="x8"/>
-      </PredictorTerm>
-    </RegressionTable>
-  </RegressionModel>
-</PMML>
index 10c37ba19b3895b182406d57f710354ba3413c40..43c1f2f68e52a9d0b1fc0409ad9991ef7922094d 100644 (file)
@@ -19,7 +19,7 @@
 
 IF(SALOME_BUILD_TESTS)
   ADD_SUBDIRECTORY(Test)
-  ADD_SUBDIRECTORY(pmml)
+  ADD_SUBDIRECTORY(pmml)  
 ENDIF(SALOME_BUILD_TESTS)
 
 # --- options ---
index 6c4f4866c58d2250b87e5a9f69c54ee2ad9eeadd..c53c72dde30766f0c8b3f89facba9a45a3c020c5 100644 (file)
@@ -114,3 +114,4 @@ IF(NOT WIN32)
   SALOME_CONFIGURE_FILE(xmlrun_orig.sh xmlrun.sh)
   ADD_TEST(NAME YacsLoaderTest COMMAND ${SHELL} YacsLoaderTest.sh)
 ENDIF()
+
index f6cd5ddb7b2406ca7aeca51f32828c079ab08836..8e355b988e4a185131db0b85846f5836612b6b3e 100755 (executable)
@@ -53,6 +53,12 @@ TARGET_LINK_LIBRARIES(TestYACSPMML pmmlLib
                       YACSBases 
                       ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
 
-ADD_TEST(TestYACSPMML TestYACSPMML)
-
 INSTALL(TARGETS TestYACSPMML DESTINATION ${SALOME_INSTALL_BINS})
+
+IF(NOT WIN32)
+  SET(SHELL /bin/sh)
+  SALOME_CONFIGURE_FILE(config_appli.xml.in config_appli.xml)  
+  SALOME_CONFIGURE_FILE(PmmlExeTest.sh.in PmmlExeTest.sh)  
+  SALOME_CONFIGURE_FILE(PmmlInSessionTest.sh.in PmmlInSessionTest.sh)
+  ADD_TEST(NAME PmmlExeTest COMMAND ${SHELL} PmmlExeTest.sh)
+ENDIF()
\ No newline at end of file
diff --git a/src/yacsloader/pmml/PmmlExeTest.sh.in b/src/yacsloader/pmml/PmmlExeTest.sh.in
new file mode 100755 (executable)
index 0000000..d5f13d6
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/bash
+# Copyright (C) 2006-2014  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+if test -f @CMAKE_CURRENT_BINARY_DIR@/config_appli.xml; then
+  if test -n "${GEOM_ROOT_DIR}" && test -d ${GEOM_ROOT_DIR}; then
+    sed -i s%\"GEOM_ROOT_DIR\"%\"${GEOM_ROOT_DIR}\"% @CMAKE_CURRENT_BINARY_DIR@/config_appli.xml
+  fi
+  if test -n "${PYHELLO_ROOT_DIR}" && test -d ${PYHELLO_ROOT_DIR}; then
+    sed -i s%\"PYHELLO_ROOT_DIR\"%\"${PYHELLO_ROOT_DIR}\"% @CMAKE_CURRENT_BINARY_DIR@/config_appli.xml
+  fi
+fi
+
+if test -f @KERNEL_ROOT_DIR@/bin/salome/appli_gen.py ; then
+
+  # --- create a SALOME Application environment
+
+  @KERNEL_ROOT_DIR@/bin/salome/appli_gen.py
+  sed -i s/\"yes\"/\"no\"/ SalomeApp.xml
+  sed -i s/\,study\,cppContainer\,registry\,moduleCatalog// SalomeApp.xml
+  sed -i s/pyContainer/pyContainer\,study\,cppContainer\,registry\,moduleCatalog/ SalomeApp.xml
+
+cat > CatalogResources.xml << EOF
+<!DOCTYPE ResourcesCatalog>
+<resources>
+   <machine hostname="localhost" />
+</resources>
+EOF
+
+  # ---------------------------------------------------------------------------
+  # --- first set of test in C++
+
+  # --- launch in background a SALOME session (servers)
+
+  ln -fs @CMAKE_SOURCE_DIR@/src/yacsloader/samples .
+  ./runAppli > log1 2>&1
+
+  # --- wait a little to let the background process define
+  #     the CORBA naming service port and host
+
+  sleep 5
+
+  # --- execute the test script in SALOME session environment
+
+  chmod +x @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+  ./runSession @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+  ret=$?
+
+  # ---------------------------------------------------------------------------
+
+  kill -9 `cat "/tmp/YACSTEST_PidEcho"`
+  ./runSession killSalome.py
+
+  echo "exec status PmmlInSessionTest.sh "  $ret
+
+  # --- delete all the SALOME Application environment
+  
+  ./bin/salome/appli_clean.sh -f
+
+else
+
+  ln -fs @CMAKE_SOURCE_DIR@/src/yacsloader/samples .
+  chmod +x @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+  @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+  ret=$?
+  echo "exec status PmmlInSessionTest.sh " $ret
+
+fi
+
+if [ $ret -ne 0 ]
+then cat /tmp/${USER}/UnitTestsResult
+else echo "Results are in /tmp/${USER}/UnitTestsResult"
+fi
+
+exit $ret
diff --git a/src/yacsloader/pmml/PmmlInSessionTest.sh.in b/src/yacsloader/pmml/PmmlInSessionTest.sh.in
new file mode 100755 (executable)
index 0000000..2ef1b9d
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/bash
+# Copyright (C) 2006-2014  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# --- script to execute in SALOME environment (use runSession)
+
+# --- wait until SALOME containers are ready
+
+python @CMAKE_CURRENT_SOURCE_DIR@/waitContainers.py
+
+# --- launch CORBA server echoSrv for tests
+
+./echoSrv &
+pidecho=$!
+echo $pidecho > "/tmp/YACSTEST_PidEcho"
+
+# Environment variables needed for the optimizer loop tests
+export LD_LIBRARY_PATH=@CMAKE_CURRENT_BINARY_DIR@:$LD_LIBRARY_PATH
+export PYTHONPATH=@CMAKE_BINARY_DIR@/src/engine_swig:$PYTHONPATH
+export PYTHONPATH=@CMAKE_BINARY_DIR@/src/runtime_swig:$PYTHONPATH
+export PYTHONPATH=@CMAKE_CURRENT_SOURCE_DIR@:$PYTHONPATH
+
+# --- launch unit tests
+
+export ROOT_SAMPLES=@CMAKE_SOURCE_DIR@/src/yacsloader/samples
+export TESTCOMPONENT_ROOT_DIR=@CMAKE_BINARY_DIR@/src/runtime/Test
+
+./TestYACSPMML
+ret=$?
+echo "exec status TestYACSPMML " $ret
+
+# --- return unit tests status
+
+exit $ret
index f8f70b6c07ecdb8eab74543135a5e5d9c68478b0..8bcf696f05dbd5fba335a1df6ab8a79e77ceb7bb 100755 (executable)
@@ -125,19 +125,7 @@ int driverTest(Proc* &p, const char* schema)
 
 void YACSPMMLBasicsTest1::setUp()
 {
-#ifdef WIN32
-    const char* p = std::getenv("YACS_ROOT_DIR");
-    std::string strP("");
-    if (p) 
-        strP = std::string(p);
-    else 
-        throw std::string("unable to get YACS_ROOT_DIR");
-    resourcesDir = strP;
-    resourcesDir += "/share/salome/yacssamples/";
-#else
-    resourcesDir =  getenv("YACS_ROOT_DIR");
-    resourcesDir += "/share/salome/yacssamples/";
-#endif      
+    resourcesDir = "samples/";    
 }
 
 void YACSPMMLBasicsTest1::tearDown()
diff --git a/src/yacsloader/pmml/config_appli.xml.in b/src/yacsloader/pmml/config_appli.xml.in
new file mode 100644 (file)
index 0000000..2c3dafa
--- /dev/null
@@ -0,0 +1,34 @@
+<!--
+  Copyright (C) 2006-2014  CEA/DEN, EDF R&D
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<application>
+<prerequisites path="profile@SALOMEYACS_VERSION@.sh"/>
+<modules>
+   <!-- variable name <MODULE>_ROOT_DIR is built with <MODULE> == name attribute value -->
+   <!-- <MODULE>_ROOT_DIR values is set with path attribute value -->
+   <!-- attribute gui (defaults = yes) indicates if the module has a gui interface -->
+   <module name="KERNEL"       gui="no"  path="@KERNEL_ROOT_DIR@"/>
+   <module name="GUI"          gui="no"  path="@GUI_ROOT_DIR@"/>
+   <module name="GEOM"                   path="GEOM_ROOT_DIR"/> <!--GEOM_ROOT_DIR will be substituted at starting of test-->
+   <module name="PYHELLO"                path="PYHELLO_ROOT_DIR"/> <!--PYHELLO_ROOT_DIR will be substituted at starting of test-->
+   <module name="YACS"                   path="@CMAKE_INSTALL_PREFIX@"/>
+</modules>
+</application>
+