[interpolation] mesh2d gateway introduced 81/20681/11
Stéphane Mottelet [Tue, 9 Oct 2018 16:35:12 +0000 (18:35 +0200)]
http://bugzilla.scilab.org/show_bug.cgi?id=8284

Change-Id: I8d5a80579a1c056b02fb0ce8abba5394395f0088

17 files changed:
scilab/CHANGES.md
scilab/modules/interpolation/Makefile.am
scilab/modules/interpolation/Makefile.in
scilab/modules/interpolation/help/en_US/mesh2d.xml [new file with mode: 0755]
scilab/modules/interpolation/includes/interpolation_functions.h
scilab/modules/interpolation/includes/interpolation_gw.hxx
scilab/modules/interpolation/macros/mesh2d.sci [new file with mode: 0644]
scilab/modules/interpolation/sci_gateway/cpp/sci_mesh2di.cpp [new file with mode: 0644]
scilab/modules/interpolation/sci_gateway/interpolation_gateway.xml
scilab/modules/interpolation/src/c/interpolation.vcxproj
scilab/modules/interpolation/src/c/interpolation.vcxproj.filters
scilab/modules/interpolation/src/c/interpolation_f_Import.def
scilab/modules/interpolation/src/fortran/interpolation_f.vfproj
scilab/modules/interpolation/src/fortran/interpolation_f2c.vcxproj
scilab/modules/interpolation/src/fortran/interpolation_f2c.vcxproj.filters
scilab/modules/interpolation/src/fortran/mesh2b.f [new file with mode: 0644]
scilab/modules/interpolation/tests/unit_tests/mesh2d.tst [new file with mode: 0644]

index fec4198..c62fbec 100644 (file)
@@ -94,6 +94,7 @@ Feature changes and additions
   - Integer and Text input are now actually supported.
   - Default input arguments can be skipped instead of still having to be provided.
   - The result string is better formatted to be easily wrappable and indentable.
+* `mesh2d` has been introduced to compute a 2d mesh from vectors (x,y) of points.
 
 Help pages:
 -----------
index 4708b2e..f4ef4fa 100644 (file)
@@ -10,7 +10,8 @@
 INTERPOLATION_FORTRAN_SOURCES = \
     src/fortran/somespline.f \
     src/fortran/dspfit.f \
-    src/fortran/cshep2d.f
+    src/fortran/cshep2d.f \
+    src/fortran/mesh2b.f
 
 INTERPOLATION_C_SOURCES = \
     src/c/interpolation.c \
@@ -27,7 +28,8 @@ GATEWAY_CPP_SOURCES = \
     sci_gateway/cpp/sci_splin2d.cpp \
     sci_gateway/cpp/sci_splin3d.cpp \
     sci_gateway/cpp/sci_bsplin3val.cpp \
-    sci_gateway/cpp/sci_eval_cshep2d.cpp
+    sci_gateway/cpp/sci_eval_cshep2d.cpp \
+               sci_gateway/cpp/sci_mesh2di.cpp
 
 libsciinterpolation_la_CPPFLAGS= \
     -I$(srcdir)/includes/ \
index 07b4b25..2c6c4ad 100644 (file)
@@ -182,7 +182,7 @@ am__dirstamp = $(am__leading_dot)dirstamp
 am__objects_1 = src/c/libsciinterpolation_algo_la-interpolation.lo \
        src/c/libsciinterpolation_algo_la-someinterp.lo
 am__objects_2 = src/fortran/somespline.lo src/fortran/dspfit.lo \
-       src/fortran/cshep2d.lo
+       src/fortran/cshep2d.lo src/fortran/mesh2b.lo
 am_libsciinterpolation_algo_la_OBJECTS = $(am__objects_1) \
        $(am__objects_2)
 libsciinterpolation_algo_la_OBJECTS =  \
@@ -205,7 +205,8 @@ am__objects_3 =  \
        sci_gateway/cpp/libsciinterpolation_la-sci_splin2d.lo \
        sci_gateway/cpp/libsciinterpolation_la-sci_splin3d.lo \
        sci_gateway/cpp/libsciinterpolation_la-sci_bsplin3val.lo \
-       sci_gateway/cpp/libsciinterpolation_la-sci_eval_cshep2d.lo
+       sci_gateway/cpp/libsciinterpolation_la-sci_eval_cshep2d.lo \
+       sci_gateway/cpp/libsciinterpolation_la-sci_mesh2di.lo
 am_libsciinterpolation_la_OBJECTS = $(am__objects_3)
 libsciinterpolation_la_OBJECTS = $(am_libsciinterpolation_la_OBJECTS)
 AM_V_P = $(am__v_P_@AM_V@)
@@ -606,7 +607,8 @@ yacc_present = @yacc_present@
 INTERPOLATION_FORTRAN_SOURCES = \
     src/fortran/somespline.f \
     src/fortran/dspfit.f \
-    src/fortran/cshep2d.f
+    src/fortran/cshep2d.f \
+    src/fortran/mesh2b.f
 
 INTERPOLATION_C_SOURCES = \
     src/c/interpolation.c \
@@ -623,7 +625,8 @@ GATEWAY_CPP_SOURCES = \
     sci_gateway/cpp/sci_splin2d.cpp \
     sci_gateway/cpp/sci_splin3d.cpp \
     sci_gateway/cpp/sci_bsplin3val.cpp \
-    sci_gateway/cpp/sci_eval_cshep2d.cpp
+    sci_gateway/cpp/sci_eval_cshep2d.cpp \
+               sci_gateway/cpp/sci_mesh2di.cpp
 
 libsciinterpolation_la_CPPFLAGS = \
     -I$(srcdir)/includes/ \
@@ -848,6 +851,8 @@ src/fortran/dspfit.lo: src/fortran/$(am__dirstamp) \
        src/fortran/$(DEPDIR)/$(am__dirstamp)
 src/fortran/cshep2d.lo: src/fortran/$(am__dirstamp) \
        src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/mesh2b.lo: src/fortran/$(am__dirstamp) \
+       src/fortran/$(DEPDIR)/$(am__dirstamp)
 
 libsciinterpolation-algo.la: $(libsciinterpolation_algo_la_OBJECTS) $(libsciinterpolation_algo_la_DEPENDENCIES) $(EXTRA_libsciinterpolation_algo_la_DEPENDENCIES) 
        $(AM_V_F77LD)$(F77LINK)  $(libsciinterpolation_algo_la_OBJECTS) $(libsciinterpolation_algo_la_LIBADD) $(LIBS)
@@ -890,6 +895,9 @@ sci_gateway/cpp/libsciinterpolation_la-sci_bsplin3val.lo:  \
 sci_gateway/cpp/libsciinterpolation_la-sci_eval_cshep2d.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciinterpolation_la-sci_mesh2di.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 
 libsciinterpolation.la: $(libsciinterpolation_la_OBJECTS) $(libsciinterpolation_la_DEPENDENCIES) $(EXTRA_libsciinterpolation_la_DEPENDENCIES) 
        $(AM_V_CXXLD)$(CXXLINK) -rpath $(pkglibdir) $(libsciinterpolation_la_OBJECTS) $(libsciinterpolation_la_LIBADD) $(LIBS)
@@ -914,6 +922,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_interp3d.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_linear_interpn.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_lsq_splin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_mesh2di.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_splin.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_splin2d.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_splin3d.Plo@am__quote@
@@ -1059,6 +1068,13 @@ sci_gateway/cpp/libsciinterpolation_la-sci_eval_cshep2d.lo: sci_gateway/cpp/sci_
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciinterpolation_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciinterpolation_la-sci_eval_cshep2d.lo `test -f 'sci_gateway/cpp/sci_eval_cshep2d.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_eval_cshep2d.cpp
 
+sci_gateway/cpp/libsciinterpolation_la-sci_mesh2di.lo: sci_gateway/cpp/sci_mesh2di.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciinterpolation_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciinterpolation_la-sci_mesh2di.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_mesh2di.Tpo -c -o sci_gateway/cpp/libsciinterpolation_la-sci_mesh2di.lo `test -f 'sci_gateway/cpp/sci_mesh2di.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mesh2di.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_mesh2di.Tpo sci_gateway/cpp/$(DEPDIR)/libsciinterpolation_la-sci_mesh2di.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_mesh2di.cpp' object='sci_gateway/cpp/libsciinterpolation_la-sci_mesh2di.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciinterpolation_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciinterpolation_la-sci_mesh2di.lo `test -f 'sci_gateway/cpp/sci_mesh2di.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_mesh2di.cpp
+
 .f.o:
        $(AM_V_F77)$(F77COMPILE) -c -o $@ $<
 
diff --git a/scilab/modules/interpolation/help/en_US/mesh2d.xml b/scilab/modules/interpolation/help/en_US/mesh2d.xml
new file mode 100755 (executable)
index 0000000..9251f46
--- /dev/null
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ * Copyright (C) 2018 - Stéphane MOTTELET
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program. *
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xml:lang="en" 
+xmlns:scilab="http://www.scilab.org"
+xml:id="mesh2d">
+  <info>
+    <pubdate>$LastChangedDate$</pubdate>
+  </info>
+  <refnamediv>
+    <refname>mesh2d</refname>
+    <refpurpose>Triangulation of n points in the plane</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <title>Calling Sequence</title>
+    <synopsis>
+triEdges = mesh2d(x, y)
+[triEdges, bdy] = mesh2d(x, y)
+triEdges = mesh2d(x, y, bdy)</synopsis>
+  </refsynopsisdiv>
+  <refsection>
+    <title>Parameters</title>
+    <variablelist>
+      <varlistentry>
+        <term>x</term>
+        <listitem>
+          <para>real vector</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>y</term>
+        <listitem>
+          <para>real vector</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>bdy</term>
+        <listitem>
+          <para>integer vector</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>triEdges</term>
+        <listitem>
+          <para>integer matrix</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsection>
+  <refsection>
+    <title>Description</title>
+    <para>
+    <literal>mesh2d</literal> computes a triangulation of <literal>n</literal> points in the plane with coordinates given by vectors<literal>x,y</literal>. It 
+     returns a matrix <literal>triEdges</literal> of size <literal>[3,nbt]</literal> where <literal>triEdges(:,i)</literal> gives the vertices numbers of triangle <literal>#i</literal> and <literal>nbt</literal> is the number of triangles.
+  </para>
+  <para>
+    When <literal>bdy</literal> is given as an input parameter this vector defines the
+    boundary and contains the indices of edges belonging to it, grouped by successive connected components. Each component is positively oriented, i.e. successive <literal>bdy(i:i+1)</literal> segments have the interior of the domain to their left. Hence, for a simply connected domain, the boundary is given counterclockwise, and eventual holes are always given clockwise.
+    Each connected component must be closed and is represented by the vector <literal>[i1,..,i_nc]</literal> such that 
+    <literal>i1 == i_nc</literal>. 
+  </para>
+  <para>
+    When <literal>bdy</literal> is given as an output parameter the boundary is computed prior to the triangulation as the convex hull of input points <literal>x,y</literal> and is returned in <literal>bdy</literal> with the same convention as above, i.e. counterclockwise sucessive vertices numbers.
+  </para>
+
+    <para>Possible error cases are the following:
+      <varlistentry>
+    <listitem>all nodes are collinear,</listitem>
+    <listitem>some points are identical,</listitem>
+    <listitem>wrong boundary array,</listitem>
+    <listitem>crossed boundary,</listitem>
+    <listitem>wrong orientation of the boundary,</listitem>
+    <listitem>size limitation,</listitem>
+    <listitem>an interior point is too close to the boundary,</listitem>
+    <listitem>an interior point is on the boundary,</listitem>
+  </varlistentry>
+  </para>
+  </refsection>
+  <refsection>
+    <title>Warning</title>
+    <para>The triangulation computed by <literal>mesh2d</literal> is not garanteed to be a Delaunay triangulation of points <literal>(x,y)</literal>.
+    </para>
+  </refsection>
+  <refsection>
+    <title>Examples</title>
+    <programlisting role="example"><![CDATA[ 
+function displayTri(X, Y, Tr)
+  plot(0,0,rect=[-1 -1 2 2])
+  [m, n] = size(Tr);
+  xpols = matrix(X(Tr), m, n); 
+  ypols = matrix(Y(Tr), m, n);
+  xfpolys(xpols, ypols, [n/4:n/4+n-1]);
+endfunction 
+
+r1 = 1;
+n1 = 20;
+u = linspace(2*%pi, 0, n1);
+xc1 = r1*cos(u(1:$-1));
+yc1 = r1*sin(u(1:$-1));
+bdy1 = [1:n1-1, 1];
+
+r2 = 2;
+n2 = 40;
+v = linspace(0, 2*%pi, n2);
+xc2 = r2*cos(v(1:$-1));
+yc2 = r2*sin(v(1:$-1));
+bdy2 = n1-1+[1:n2-1, 1];
+
+xr = (rand(1, 100)-.5)*2*r2;
+yr = (rand(1, 100)-.5)*2*r2;
+r = sqrt(xr.^2+yr.^2);
+
+clf
+gcf().color_map = rand(400, 3); 
+gcf().position(4)=300
+
+// [t, bdy] = mesh2d(x, y) syntax
+subplot(1, 2, 1)
+k = find(r < = r2);
+[t, bdy] = mesh2d(xr(k), yr(k));
+displayTri(xr(k), yr(k), t)
+plot(xr(k(bdy)), yr(k(bdy)),"-ok","thickness",2)
+xtitle("[triEdges, bdy] = mesh2d(x, y)")
+isoview
+
+
+// t = mesh2d(x, y, bdy) syntax
+subplot(1, 2, 2)
+k = find((r > =  r1) & (r < =  r2));
+x = [xc1 xc2 xr(k)];
+y = [yc1 yc2 yr(k)];
+t = mesh2d(x, y, [bdy1 bdy2]);
+displayTri(x, y, t)
+plot(x(bdy1), y(bdy1),"-ok","thickness",2)
+plot(x(bdy2), y(bdy2),"-ok","thickness",2)
+xtitle("triEdges = mesh2d(x, y, bdy)")
+isoview
+ ]]></programlisting>
+ <scilab:image>
+function displayTri(X, Y, Tr)
+  plot(0,0,rect=[-1 -1 2 2])
+  [m, n] = size(Tr);
+  xpols = matrix(X(Tr), m, n); 
+  ypols = matrix(Y(Tr), m, n);
+  xfpolys(xpols, ypols, [n/4:n/4+n-1]);
+endfunction 
+
+r1 = 1;
+n1 = 20;
+u = linspace(2*%pi, 0, n1);
+xc1 = r1*cos(u(1:$-1));
+yc1 = r1*sin(u(1:$-1));
+bdy1 = [1:n1-1, 1];
+
+r2 = 2;
+n2 = 40;
+v = linspace(0, 2*%pi, n2);
+xc2 = r2*cos(v(1:$-1));
+yc2 = r2*sin(v(1:$-1));
+bdy2 = n1-1+[1:n2-1, 1];
+
+xr = (rand(1, 100)-.5)*2*r2;
+yr = (rand(1, 100)-.5)*2*r2;
+r = sqrt(xr.^2+yr.^2);
+
+clf
+gcf().color_map = rand(400, 3); 
+gcf().position(4)=300
+
+// [t, bdy] = mesh2d(x, y) syntax
+subplot(1, 2, 1)
+k = find(r &lt; = r2);
+[t, bdy] = mesh2d(xr(k), yr(k));
+displayTri(xr(k), yr(k), t)
+plot(xr(k(bdy)), yr(k(bdy)),"-ok","thickness",2)
+xtitle("[triEdges, bdy] = mesh2d(x, y)")
+isoview
+
+
+// t = mesh2d(x, y, bdy) syntax
+subplot(1, 2, 2)
+k = find((r &gt; =  r1) &amp; (r &lt; =  r2));
+x = [xc1 xc2 xr(k)];
+y = [yc1 yc2 yr(k)];
+t = mesh2d(x, y, [bdy1 bdy2]);
+displayTri(x, y, t)
+plot(x(bdy1), y(bdy1),"-ok","thickness",2)
+plot(x(bdy2), y(bdy2),"-ok","thickness",2)
+xtitle("triEdges = mesh2d(x, y, bdy)")
+isoview
+
+
+
+ </scilab:image>
+  </refsection>
+  <refsection>
+    <title>References</title>
+    <para><literal>mesh2d</literal> was previously part of the <literal>metanet</literal> ATOMS module.
+    </para>
+  </refsection>
+</refentry>
index 33c0a8d..4acbac0 100644 (file)
@@ -54,3 +54,6 @@ extern double C2F(cs2val)(double* px, double* py, int* n, double* x, double* y,
 extern int C2F(cs2grd)(double* px, double* py, int* n, double* x, double* y, double* f, int* nr, int* lcell, int* lnext, double* xmin, double* ymin, double* dx, double* dy, double* rmax, double* rw, double* a, double* c, double* cx, double* cy, int* ier);
 extern int C2F(cs2hes)(double* px, double* py, int* n, double* x, double* y, double* f, int* nr, int* lcell, int* lnext, double* xmin, double* ymin, double* dx, double* dy, double* rmax, double* rw, double* a, double* c, double* cx, double* cy, double* cxx, double* cxy, double* cyy, int* ier);
 
+//mesh2d
+extern int C2F(deumesh)(int *, int *, int *, double *, double *, int *,int *, int *, int *, int*);
+extern int C2F(mesh2b)(int *, int *, int *, int *, double *, double *, int *, int *, int *, int *,int *);
\ No newline at end of file
index f9e2516..c88f704 100644 (file)
@@ -34,5 +34,6 @@ CPP_GATEWAY_PROTOTYPE_EXPORT(sci_eval_cshep2d,      INTERPOLATION_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_splin3d,           INTERPOLATION_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_interp3d,          INTERPOLATION_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_bsplin3val,        INTERPOLATION_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_mesh2di,           INTERPOLATION_IMPEXP);
 
 #endif /* !__INTERPOLATION_GW_HXX__ */
diff --git a/scilab/modules/interpolation/macros/mesh2d.sci b/scilab/modules/interpolation/macros/mesh2d.sci
new file mode 100644 (file)
index 0000000..d67cec4
--- /dev/null
@@ -0,0 +1,128 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+//
+// Copyright (C) 2018 - Stéphane MOTTELET
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// For more information, see the COPYING file which you should have received
+// along with this program.
+//
+
+function [tri, hull]=mesh2d(varargin)
+    if argn(2) == 0 then
+        x = rand(10,1,"normal");
+        y = rand(10,1,"normal");
+        [tri, hull]=mesh2d(x,y);
+        tri = [tri;tri(1,:)];
+        plot(x,y,'o');
+        xstring(x,y,string(1:size(x,"*")));
+        xpolys(matrix(x(tri),size(tri)),matrix(y(tri),size(tri)));
+        plot(x(hull),y(hull),'-r');
+        return
+    end
+    if argn(2) < 2 || argn(2) > 3
+        error(msprintf(_("%s: Wrong number of input argument(s): %d or %d expected.\n"), "mesh2d", 2, 3));
+    end
+    if argn(2) == 3 && argn(1) <> 1
+        error(msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "mesh2d", 1));
+    end
+    if argn(2) == 2 && argn(1) > 2
+        error(msprintf(_("%s: Wrong number of output argument(s): %d or %d expected.\n"), "mesh2d", 1, 2));
+    end
+    for i = 1:length(varargin)
+        if type(varargin(i)) <> 1 || ~isreal(varargin(i))
+            error(msprintf(_("%s: Wrong type for argument #%d: Real matrix expected.\n"), "mesh2d", i));
+        end
+    end
+    if (size(varargin(1),"*") <> size(varargin(2),"*"))
+        error(msprintf(_("%s: Arguments #%d and #%d must have the same sizes.\n"), "mesh2d", 1,2));
+    end
+    if (size(varargin(1),"*") < 3)
+        error(msprintf(_("%s: Wrong size for input argument #%d : At least %d elements expected.\n"), "mesh2d)", 1, 3));
+    end
+    if argn(2) == 2
+        [hull, area] = quickhull(varargin(1), varargin(2));
+        if area < %eps
+            error(msprintf(_("%s: all points are aligned.\n"),"mesh2d"))
+        end
+        tri = mesh2di(varargin(1), varargin(2), hull);
+    else
+        tri = mesh2di(varargin(1), varargin(2), varargin(3));
+    end
+end
+
+function [ind, area]=quickhull(x, y)
+    // https://fr.wikipedia.org/wiki/Quickhull
+    // Quickhull is a method of computing the convex hull of a finite set of points in the plane.
+    // It uses a divide and conquer approach similar to that of quicksort, from which its name derives.
+    // Its best case complexity is considered to be O(n * log(n))
+    // The following implementation supports all degenerates cases.
+
+    // Determine vertices of minimum and maximum abcissa
+    [minx,imin] = min(x(:));
+    [maxx,imax] = max(x(:));
+    if maxx-minx < %eps * (1 + max(maxx,minx))
+      [miny,imin] = min(y(:));
+      [maxy,imax] = max(y(:));
+      if maxy-miny < %eps * (1 + max(maxy,miny))
+        error(msprintf(_("%s: all points are coincident.\n"),"mesh2d"))
+      end
+    end  
+    
+    ind = 1:size(x,"*");
+    ind([imin;imax]) = [];
+    // Call recursive divide and conquer function
+    // 1-for vertices under segment [imin imax]
+    [ind1,remain] = conquer(x(:),y(:),ind,[imin;imax]);
+    if ~isempty(remain) then
+        // 2-for vertices (if any) above segment [imin imax]
+        ind2 = conquer(x(:),y(:),remain,[imax;imin]);
+        ind = [ind1(1:$-1);ind2];
+    else // if all vertices were under segment [imin imax]
+        ind=[ind1;imin];
+    end
+    area = sum(x(ind(1:$-1)).*y(ind(2:$))-x(ind(2:$)).*y(ind(1:$-1)))/2
+end
+
+function [out, remain]=conquer(x, y, ind, indH)
+    out = indH;
+    xh = x(indH);
+    yh = y(indH);
+    // compute signed distance w.r.t to segment [indH(1) indH(2)]
+    u=[xh(2)-xh(1);yh(2)-yh(1)];
+    d = (y(ind)-yh(1))*u(1)-(x(ind)-xh(1))*u(2);
+    // 1-divide
+    // ind(iplus) = vertices to the right of segment [indH(1) indH(2)]
+    iplus = find(d<=0);
+    remain = ind;
+    remain(iplus) = [];
+    if ~isempty(iplus) then
+        // #indnew = the furthest vertex to the right of segment [indH(1),indH(2)
+        [ma,ima]=min(d(iplus));
+        if ma > -%eps // all the righ-of-segment vertices are *on* the segment
+            iOnSeg = ind(iplus);
+            // we sort vertices by increasing L_1 distance from indH(1)
+            [sorted,iSorted] = gsort(abs(x(iOnSeg)-x(indH(1)))+...
+                                     abs(y(iOnSeg)-y(indH(1))),'g','i');
+            out = [indH(1);iOnSeg(iSorted)';indH(2)]
+            return
+        end
+        indnew = ind(iplus(ima));
+        iplus(ima) = [];
+        // 2-conquer
+        if ~isempty(iplus) then
+            // process ind(iplus) vertices w.r.t. segment [indH(1) indnew]
+            [ind1,remainplus]=conquer(x,y,ind(iplus),[indH(1);indnew]);
+            if ~isempty(remainplus) then
+                // process remaining vertices w.r.t. segment [indnew indH(2)]
+                ind2=conquer(x,y,remainplus,[indnew;indH(2)]);
+                out = [ind1(1:$-1);ind2];
+            else
+                out = [ind1;indH(2)];
+            end
+        else // #indnew vertex was alone to the right of [indH(1) indH(2)]
+            out = [indH(1);indnew;indH(2)];
+        end
+    end
+end
+
diff --git a/scilab/modules/interpolation/sci_gateway/cpp/sci_mesh2di.cpp b/scilab/modules/interpolation/sci_gateway/cpp/sci_mesh2di.cpp
new file mode 100644 (file)
index 0000000..5881831
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2018 - Stéphane MOTTELET
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ */
+/*--------------------------------------------------------------------------*/
+#include "interpolation_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "sparse.hxx"
+#include <numeric>
+
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "interpolation_functions.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_mesh2di(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    if (in.size() != 3)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), "mesh2di", 3);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount > 1)
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d expected.\n"), "mesh2di", 1);
+        return types::Function::Error;
+    }
+
+    for (int i = 0; i < in.size(); i++)
+    {
+        if (!in[i]->isDouble() | in[i]->getAs<types::Double>()->isComplex())
+        {
+            Scierror(999, _("%s: Wrong type for argument #%d: Real matrix expected.\n"), "mesh2di", i);
+            return types::Function::Error;
+        }
+    }
+
+    types::Double *pDblx = in[0]->getAs<types::Double>();
+    types::Double *pDbly = in[1]->getAs<types::Double>();
+
+    if (pDblx->getSize() != pDblx->getSize())
+    {
+        Scierror(999, _("%s: Arguments #%d and #%d must have the same sizes.\n"), "mesh2di", 1,2);
+        return types::Function::Error;
+    }
+
+    int iNbNodes = pDblx->getSize();
+
+    if (iNbNodes < 3)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d : At least %d elements expected.\n"), "mesh2di", 1, 3);
+        return types::Function::Error;
+    }
+    
+    double* pdblx = pDblx->get();
+    double* pdbly = pDbly->get();
+    std::vector<int> bdy;
+
+    // verify boundary specification
+    types::Double* pDblBdy = in[2]->getAs<types::Double>();
+    int iStart = -1;
+
+    for (int i=0; i < pDblBdy->getSize(); i++)
+    {
+        double dblCurrNode = pDblBdy->get(i);
+        if (dblCurrNode != std::round(dblCurrNode) || (int)dblCurrNode < 1 || (int)dblCurrNode > iNbNodes)
+        {
+            Scierror(999, _("%s: Wrong value for input argument #%d: incorrect element #%d\n"), "mesh2di", 3, i+1);
+            return types::Function::Error;
+        }
+        // if (iStart < 0) next node is the first of a connected component
+        // else if iCurrNode == iStart, close the current component (set iStart = -1)
+        iStart = iStart < 0 ? (int)dblCurrNode : ((int)dblCurrNode == iStart ? -1 : iStart);
+        bdy.push_back((int)dblCurrNode);
+    }
+    // iStart should be equal to -1 (all components closed)
+    if (iStart != -1)
+    {
+        Scierror(999, _("%s: last connected component of boundary is not closed\n"), "mesh2di");
+        return types::Function::Error;
+    }
+
+    // allocate working arrays
+    int* piTri = NULL;
+    int iNbTri = 0;
+    int iErr = 0;
+    int in4 = 4*iNbNodes-4;
+    int in6 = 6*(2*iNbNodes-2);
+    int* piWork = new int[in4];
+    piTri = new int[3*in4];
+    int iNbBdyNodes = bdy.size();
+    
+    // mesh2b wants xy=[x(:)';y(:)'] + a clone of it
+    types::Double* pDblxy = new types::Double(2,iNbNodes);
+    for (int i=0; i < iNbNodes; i++)
+    {
+         pDblxy->set(0,i,pDblx->get(i));
+         pDblxy->set(1,i,pDbly->get(i));
+    }
+    types::Double* pDblxyClone = pDblxy->clone();
+
+    C2F(mesh2b)(&iNbNodes, &in6, &in4, &iNbBdyNodes, pDblxy->get(), pDblxyClone->get(),
+                 piTri, piWork, &bdy.front(), &iNbTri, &iErr);
+
+    pDblxy->killMe();
+    pDblxyClone->killMe();
+    delete[] piWork;
+
+    if (iErr)
+    {
+        std::string errStr[] = {
+        _("%s: some points are identical.\n"),
+        _("%s: some points are identical.\n"),
+        _("%s: all points are aligned.\n"),
+        _("%s: wrong boundary array.\n"),
+        _("%s: crossed boundary.\n"),
+        _("%s: wrong orientation of the boundary.\n"),
+        _("%s: size limitation.\n"),
+        _("%s: crossed boundary.\n"),
+        _("%s: an interior point is on the boundary.\n"),
+        _("%s: an interior point is too close to the boundary.\n"),
+        _("%s: some points are identical or size limitation.\n")};
+
+        Scierror(999, errStr[iErr-1].c_str(), "mesh2di");
+
+        delete[] piTri;
+
+        return types::Function::Error;
+    }
+    
+    // fix empty triangles + eventual wrong orientation (should be counter clock-wise)
+    types::Double* pDblTrianglesNodes = new types::Double(3,iNbTri);
+    double* pdblTri = pDblTrianglesNodes->get();
+    int iTriLin = 0;
+    int iTriLinOrig = 0;
+    int i0, i1, i2;
+
+    for (int i = 0; i < iNbTri; i++)
+    {
+        i0 = piTri[iTriLinOrig++];
+        i1 = piTri[iTriLinOrig++];
+        i2 = piTri[iTriLinOrig++];
+        if (i0>0) // triangle is not empty
+        {
+            pdblTri[iTriLin++] = (double)i0;
+            // compute determinant of (i0->i1) and (i0->i2) vectors
+            if ((pdblx[i1-1]-pdblx[i0-1])*(pdbly[i2-1]-pdbly[i0-1])-
+                (pdblx[i2-1]-pdblx[i0-1])*(pdbly[i1-1]-pdbly[i0-1]) > 0.0)
+            {
+                pdblTri[iTriLin++] = (double)i1;
+                pdblTri[iTriLin++] = (double)i2;
+            }
+            else
+            {
+                pdblTri[iTriLin++] = (double)i2;
+                pdblTri[iTriLin++] = (double)i1;
+            }
+        }
+    }
+    delete[] piTri;
+    pDblTrianglesNodes->resize(3,iTriLin/3);
+
+    out.push_back(pDblTrianglesNodes);
+
+    return types::Function::OK;
+}
+
index 71b65d4..0962b5d 100644 (file)
@@ -33,4 +33,5 @@
     <gateway name="sci_splin3d"         function="splin3d"          type="1" />
     <gateway name="sci_interp3d"        function="interp3d"         type="1" />
     <gateway name="sci_bsplin3val"      function="bsplin3val"       type="1" />
+    <gateway name="sci_mesh2di"         function="mesh2di"          type="1" />
 </module>
index 8f95e04..e8ca961 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{22F14F8F-67C6-49B1-A730-CE70FFE9EB61}</ProjectGuid>
-    <RootNamespace>interpolation</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <WholeProgramOptimization>false</WholeProgramOptimization>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <WholeProgramOptimization>false</WholeProgramOptimization>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../core/includes;../../../api_scilab/includes;../../../threads/includes;../../../elementary_functions/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;INTERPOLATION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <PreLinkEvent>
-      <Message>Make dependencies</Message>
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{22F14F8F-67C6-49B1-A730-CE70FFE9EB61}</ProjectGuid>\r
+    <RootNamespace>interpolation</RootNamespace>\r
+    <Keyword>Win32Proj</Keyword>\r
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <WholeProgramOptimization>false</WholeProgramOptimization>\r
+    <PlatformToolset>v141</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v141</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <WholeProgramOptimization>false</WholeProgramOptimization>\r
+    <PlatformToolset>v141</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v141</PlatformToolset>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../core/includes;../../../api_scilab/includes;../../../threads/includes;../../../elementary_functions/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;INTERPOLATION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <WarningLevel>Level3</WarningLevel>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Message>Make dependencies</Message>\r
       <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)interpolation_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)interpolation_f.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>
-    </PreLinkEvent>
-    <Link>
-      <AdditionalDependencies>core.lib;interpolation_f.lib;slatec_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
-      <IgnoreSpecificDefaultLibraries>
-      </IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
-      <TargetMachine>MachineX86</TargetMachine>
-      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../core/includes;../../../api_scilab/includes;../../../threads/includes;../../../elementary_functions/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;INTERPOLATION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <PreLinkEvent>
-      <Message>Make dependencies</Message>
+lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalDependencies>core.lib;interpolation_f.lib;slatec_f.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>\r
+      <IgnoreSpecificDefaultLibraries>\r
+      </IgnoreSpecificDefaultLibraries>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>\r
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../core/includes;../../../api_scilab/includes;../../../threads/includes;../../../elementary_functions/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;INTERPOLATION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <WarningLevel>Level3</WarningLevel>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Message>Make dependencies</Message>\r
       <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)interpolation_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)interpolation_f.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>
-    </PreLinkEvent>
-    <Link>
-      <AdditionalDependencies>core.lib;interpolation_f.lib;slatec_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
-      <IgnoreSpecificDefaultLibraries>
-      </IgnoreSpecificDefaultLibraries>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
-      <TargetMachine>MachineX64</TargetMachine>
-      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../core/includes;../../../api_scilab/includes;../../../threads/includes;../../../elementary_functions/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;INTERPOLATION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-    </ClCompile>
-    <PreLinkEvent>
-      <Message>Make dependencies</Message>
+lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalDependencies>core.lib;interpolation_f.lib;slatec_f.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>\r
+      <IgnoreSpecificDefaultLibraries>\r
+      </IgnoreSpecificDefaultLibraries>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>\r
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../core/includes;../../../api_scilab/includes;../../../threads/includes;../../../elementary_functions/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;INTERPOLATION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Message>Make dependencies</Message>\r
       <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)interpolation_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)interpolation_f.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>
-    </PreLinkEvent>
-    <Link>
-      <AdditionalDependencies>core.lib;interpolation_f.lib;slatec_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
-      <TargetMachine>MachineX86</TargetMachine>
-      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <IgnoreSpecificDefaultLibraries>
-      </IgnoreSpecificDefaultLibraries>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../core/includes;../../../api_scilab/includes;../../../threads/includes;../../../elementary_functions/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;INTERPOLATION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <StringPooling>true</StringPooling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-    </ClCompile>
-    <PreLinkEvent>
-      <Message>Make dependencies</Message>
+lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalDependencies>core.lib;interpolation_f.lib;slatec_f.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>\r
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+      <IgnoreSpecificDefaultLibraries>\r
+      </IgnoreSpecificDefaultLibraries>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../output_stream/includes;../../../localization/includes;../../../string/includes;../../../core/includes;../../../api_scilab/includes;../../../threads/includes;../../../elementary_functions/includes;../../../dynamic_link/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;INTERPOLATION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Message>Make dependencies</Message>\r
       <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)interpolation_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)interpolation_f.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>
-    </PreLinkEvent>
-    <Link>
-      <AdditionalDependencies>core.lib;interpolation_f.lib;slatec_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
-      <GenerateDebugInformation>false</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
-      <TargetMachine>MachineX64</TargetMachine>
-      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <IgnoreSpecificDefaultLibraries>
-      </IgnoreSpecificDefaultLibraries>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_bsplin3val.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_cshep2d.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_eval_cshep2d.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp2d.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp3d.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_linear_interpn.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_lsq_splin.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin2d.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin3d.cpp" />
-    <ClCompile Include="DllmainInterpolation.c" />
-    <ClCompile Include="interpolation.c" />
-    <ClCompile Include="someinterp.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\includes\dynlib_interpolation.h" />
-    <ClInclude Include="interpolation.h" />
-    <ClInclude Include="someinterp.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\locales\interpolation.pot" />
-    <None Include="interpolation_f_Import.def" />
-    <None Include="core_import.def" />
-    <None Include="..\..\interpolation.iss" />
-    <None Include="..\..\sci_gateway\interpolation_gateway.xml" />
-    <None Include="..\..\Makefile.am" />
-    <None Include="slatec_f_Import.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="interpolation.rc" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">
-      <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
-      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\ast\ast.vcxproj">
-      <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\elementary_functions\src\c\elementary_functions.vcxproj">
-      <Project>{5b110267-7c18-437c-b87d-dba2b50729e9}</Project>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
-      <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
-      <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\string\src\c\string.vcxproj">
-      <Project>{8d45767a-9b03-4905-97f6-d2f3f79141ea}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
+lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalDependencies>core.lib;interpolation_f.lib;slatec_f.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>\r
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+      <IgnoreSpecificDefaultLibraries>\r
+      </IgnoreSpecificDefaultLibraries>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_bsplin3val.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_cshep2d.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_eval_cshep2d.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp2d.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp3d.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_linear_interpn.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_lsq_splin.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_mesh2di.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin2d.cpp" />\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin3d.cpp" />\r
+    <ClCompile Include="DllmainInterpolation.c" />\r
+    <ClCompile Include="interpolation.c" />\r
+    <ClCompile Include="someinterp.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\includes\dynlib_interpolation.h" />\r
+    <ClInclude Include="interpolation.h" />\r
+    <ClInclude Include="someinterp.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\..\locales\interpolation.pot" />\r
+    <None Include="interpolation_f_Import.def" />\r
+    <None Include="core_import.def" />\r
+    <None Include="..\..\interpolation.iss" />\r
+    <None Include="..\..\sci_gateway\interpolation_gateway.xml" />\r
+    <None Include="..\..\Makefile.am" />\r
+    <None Include="slatec_f_Import.def" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="interpolation.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">\r
+      <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">\r
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\..\..\ast\ast.vcxproj">\r
+      <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\..\..\elementary_functions\src\c\elementary_functions.vcxproj">\r
+      <Project>{5b110267-7c18-437c-b87d-dba2b50729e9}</Project>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">\r
+      <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">\r
+      <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+    <ProjectReference Include="..\..\..\string\src\c\string.vcxproj">\r
+      <Project>{8d45767a-9b03-4905-97f6-d2f3f79141ea}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
 </Project>
\ No newline at end of file
index a7d06cf..51f940c 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{95764ecf-f81b-4a56-9498-7470bdb3130c}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{60ddd6b5-c21d-4a53-b620-fcf0511d5ae8}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl</Extensions>
-    </Filter>
-    <Filter Include="localization">
-      <UniqueIdentifier>{2ed13f31-c480-4101-9aff-3c8072452c61}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Libraries Dependencies">
-      <UniqueIdentifier>{0e942ba0-4f67-4f79-aae5-0a6e0d6b4e7b}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Libraries Dependencies\Imports">
-      <UniqueIdentifier>{1f757c76-ad7f-4ef5-bf1a-a24cf5f1d296}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{c65543b3-bb81-465a-bfaa-8b6afa1fb9e5}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="DllmainInterpolation.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="interpolation.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="someinterp.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_bsplin3val.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_cshep2d.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_eval_cshep2d.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp2d.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp3d.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_linear_interpn.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_lsq_splin.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin2d.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin3d.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\..\includes\dynlib_interpolation.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="interpolation.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="someinterp.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="interpolation_f_Import.def">
-      <Filter>Libraries Dependencies\Imports</Filter>
-    </None>
-    <None Include="core_import.def">
-      <Filter>Libraries Dependencies\Imports</Filter>
-    </None>
-    <None Include="..\..\interpolation.iss" />
-    <None Include="..\..\sci_gateway\interpolation_gateway.xml" />
-    <None Include="..\..\Makefile.am" />
-    <None Include="slatec_f_Import.def">
-      <Filter>Libraries Dependencies\Imports</Filter>
-    </None>
-    <None Include="..\..\locales\interpolation.pot">
-      <Filter>localization</Filter>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="interpolation.rc">
-      <Filter>Resource Files</Filter>
-    </ResourceCompile>
-  </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{95764ecf-f81b-4a56-9498-7470bdb3130c}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{60ddd6b5-c21d-4a53-b620-fcf0511d5ae8}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl</Extensions>\r
+    </Filter>\r
+    <Filter Include="localization">\r
+      <UniqueIdentifier>{2ed13f31-c480-4101-9aff-3c8072452c61}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Libraries Dependencies">\r
+      <UniqueIdentifier>{0e942ba0-4f67-4f79-aae5-0a6e0d6b4e7b}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Libraries Dependencies\Imports">\r
+      <UniqueIdentifier>{1f757c76-ad7f-4ef5-bf1a-a24cf5f1d296}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{c65543b3-bb81-465a-bfaa-8b6afa1fb9e5}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="DllmainInterpolation.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="interpolation.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="someinterp.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_bsplin3val.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_cshep2d.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_eval_cshep2d.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp2d.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_interp3d.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_linear_interpn.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_lsq_splin.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin2d.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_splin3d.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_mesh2di.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\includes\dynlib_interpolation.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="interpolation.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="someinterp.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="interpolation_f_Import.def">\r
+      <Filter>Libraries Dependencies\Imports</Filter>\r
+    </None>\r
+    <None Include="core_import.def">\r
+      <Filter>Libraries Dependencies\Imports</Filter>\r
+    </None>\r
+    <None Include="..\..\interpolation.iss" />\r
+    <None Include="..\..\sci_gateway\interpolation_gateway.xml" />\r
+    <None Include="..\..\Makefile.am" />\r
+    <None Include="slatec_f_Import.def">\r
+      <Filter>Libraries Dependencies\Imports</Filter>\r
+    </None>\r
+    <None Include="..\..\locales\interpolation.pot">\r
+      <Filter>localization</Filter>\r
+    </None>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="interpolation.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
 </Project>
\ No newline at end of file
index 69e5f02..52f7500 100644 (file)
@@ -19,4 +19,5 @@ bicubicinterpwithgradandhes_
 evalpwhermite_
 cs2val_
 cs2grd_
-cs2hes_
\ No newline at end of file
+cs2hes_
+mesh2b_
index 23c33b1..a081046 100644 (file)
@@ -92,6 +92,7 @@ lib /DEF:&quot;$(InputDir)slatec_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:
                <File RelativePath=".\cshep2d.f"/>
                <File RelativePath=".\dspfit.f"/>
                <File RelativePath=".\somespline.f"/></Filter>
+               <File RelativePath=".\mesh2b.f"/></Filter>
                <File RelativePath="..\..\sci_gateway\interpolation_gateway.xml"/>
                <File RelativePath="..\..\Makefile.am"/></Files>
        <Globals/></VisualStudioProject>
index 8639b57..fa79d3a 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectName>interpolation_f</ProjectName>
-    <ProjectGuid>{D98B0986-14E4-44FD-B006-CACE4B291F38}</ProjectGuid>
-    <RootNamespace>interpolation_f2c</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <PlatformToolset>v141</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-    <Import Project="..\..\..\..\Visual-Studio-settings\f2c.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PreBuildEvent>
-      <Message>Build Dependencies</Message>
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectName>interpolation_f</ProjectName>\r
+    <ProjectGuid>{D98B0986-14E4-44FD-B006-CACE4B291F38}</ProjectGuid>\r
+    <RootNamespace>interpolation_f2c</RootNamespace>\r
+    <Keyword>Win32Proj</Keyword>\r
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <PlatformToolset>v141</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <PlatformToolset>v141</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <PlatformToolset>v141</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <PlatformToolset>v141</PlatformToolset>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+    <Import Project="..\..\..\..\Visual-Studio-settings\f2c.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <PreBuildEvent>\r
+      <Message>Build Dependencies</Message>\r
       <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;INTERPOLATION_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <PreLinkEvent>
-      <Message>Build $(ProjectName).def</Message>
+lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>\r
+    </PreBuildEvent>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;INTERPOLATION_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <WarningLevel>Level3</WarningLevel>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Message>Build $(ProjectName).def</Message>\r
       <Command>setlocal EnableDelayedExpansion
 cd $(ConfigurationName)
 set LIST_OBJ=
@@ -104,41 +104,41 @@ for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
 copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
 del *.def &gt;nul
 cd ..
-</Command>
-    </PreLinkEvent>
-    <Link>
-      <AdditionalOptions>/ignore:4049 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>core.lib;elementary_functions_f.lib;slatec_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
-      <ModuleDefinitionFile>interpolation_f.def</ModuleDefinitionFile>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
-      <TargetMachine>MachineX86</TargetMachine>
-      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <PreBuildEvent>
-      <Message>Build Dependencies</Message>
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/ignore:4049 %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>core.lib;elementary_functions_f.lib;slatec_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>\r
+      <ModuleDefinitionFile>interpolation_f.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>\r
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <PreBuildEvent>\r
+      <Message>Build Dependencies</Message>\r
       <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;INTERPOLATION_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-    </ClCompile>
-    <PreLinkEvent>
-      <Message>Build $(ProjectName).def</Message>
+lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>\r
+    </PreBuildEvent>\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;INTERPOLATION_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+      <WarningLevel>Level3</WarningLevel>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Message>Build $(ProjectName).def</Message>\r
       <Command>setlocal EnableDelayedExpansion
 cd $(ConfigurationName)
 set LIST_OBJ=
@@ -147,39 +147,39 @@ for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
 copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
 del *.def &gt;nul
 cd ..
-</Command>
-    </PreLinkEvent>
-    <Link>
-      <AdditionalOptions>/ignore:4049 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>core.lib;elementary_functions_f.lib;slatec_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
-      <ModuleDefinitionFile>interpolation_f.def</ModuleDefinitionFile>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
-      <TargetMachine>MachineX64</TargetMachine>
-      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PreBuildEvent>
-      <Message>Build Dependencies</Message>
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/ignore:4049 %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>core.lib;elementary_functions_f.lib;slatec_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>\r
+      <ModuleDefinitionFile>interpolation_f.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>\r
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <PreBuildEvent>\r
+      <Message>Build Dependencies</Message>\r
       <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>
-    </PreBuildEvent>
-    <ClCompile>
-      <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;INTERPOLATION_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-    </ClCompile>
-    <PreLinkEvent>
-      <Message>Build $(ProjectName).def</Message>
+lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>\r
+    </PreBuildEvent>\r
+    <ClCompile>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;INTERPOLATION_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Message>Build $(ProjectName).def</Message>\r
       <Command>setlocal EnableDelayedExpansion
 cd $(ConfigurationName)
 set LIST_OBJ=
@@ -188,44 +188,44 @@ for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
 copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
 del *.def &gt;nul
 cd ..
-</Command>
-    </PreLinkEvent>
-    <Link>
-      <AdditionalOptions>/ignore:4049 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>core.lib;elementary_functions_f.lib;slatec_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
-      <ModuleDefinitionFile>interpolation_f.def</ModuleDefinitionFile>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
-      <TargetMachine>MachineX86</TargetMachine>
-      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <PreBuildEvent>
-      <Message>Build Dependencies</Message>
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/ignore:4049 %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>core.lib;elementary_functions_f.lib;slatec_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>\r
+      <ModuleDefinitionFile>interpolation_f.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>\r
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <PreBuildEvent>\r
+      <Message>Build Dependencies</Message>\r
       <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL
-lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>
-    </PreBuildEvent>
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;INTERPOLATION_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <WarningLevel>Level3</WarningLevel>
-      <MultiProcessorCompilation>true</MultiProcessorCompilation>
-    </ClCompile>
-    <PreLinkEvent>
-      <Message>Build $(ProjectName).def</Message>
+lib /DEF:"$(ProjectDir)slatec_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)slatec_f.lib" 1&gt;NUL 2&gt;NUL</Command>\r
+    </PreBuildEvent>\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
+      <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;INTERPOLATION_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
+    </ClCompile>\r
+    <PreLinkEvent>\r
+      <Message>Build $(ProjectName).def</Message>\r
       <Command>setlocal EnableDelayedExpansion
 cd $(ConfigurationName)
 set LIST_OBJ=
@@ -234,50 +234,52 @@ for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
 copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
 del *.def &gt;nul
 cd ..
-</Command>
-    </PreLinkEvent>
-    <Link>
-      <AdditionalOptions>/ignore:4049 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>core.lib;elementary_functions_f.lib;slatec_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
-      <ModuleDefinitionFile>interpolation_f.def</ModuleDefinitionFile>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
-      <TargetMachine>MachineX64</TargetMachine>
-      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="common_f2c.c" />
-    <ClCompile Include="cshep2d.c" />
-    <ClCompile Include="dspfit.c" />
-    <ClCompile Include="somespline.c" />
-  </ItemGroup>
-  <ItemGroup>
-    <f2c_rule Include="cshep2d.f" />
-    <f2c_rule Include="dspfit.f" />
-    <f2c_rule Include="somespline.f" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\sci_gateway\interpolation_gateway.xml" />
-    <None Include="..\..\Makefile.am" />
-    <None Include="elementary_functions_f_Import.def" />
-    <None Include="core_import.def" />
-    <None Include="slatec_f_Import.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">
-      <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-    <Import Project="..\..\..\..\Visual-Studio-settings\f2c.targets" />
-  </ImportGroup>
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/ignore:4049 %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>core.lib;elementary_functions_f.lib;slatec_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>\r
+      <ModuleDefinitionFile>interpolation_f.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>\r
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="common_f2c.c" />\r
+    <ClCompile Include="cshep2d.c" />\r
+    <ClCompile Include="dspfit.c" />\r
+    <ClCompile Include="mesh2b.c" />\r
+    <ClCompile Include="somespline.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <f2c_rule Include="cshep2d.f" />\r
+    <f2c_rule Include="dspfit.f" />\r
+    <f2c_rule Include="mesh2b.f" />\r
+    <f2c_rule Include="somespline.f" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\..\sci_gateway\interpolation_gateway.xml" />\r
+    <None Include="..\..\Makefile.am" />\r
+    <None Include="elementary_functions_f_Import.def" />\r
+    <None Include="core_import.def" />\r
+    <None Include="slatec_f_Import.def" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">\r
+      <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+    <Import Project="..\..\..\..\Visual-Studio-settings\f2c.targets" />\r
+  </ImportGroup>\r
 </Project>
\ No newline at end of file
index 0d58454..ea620f4 100644 (file)
@@ -1,61 +1,67 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
-    </Filter>
-    <Filter Include="Fortran files">
-      <UniqueIdentifier>{5bded6a7-2b35-4fd3-b2e1-ae7409e496aa}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Libraries Dependencies">
-      <UniqueIdentifier>{76cb8868-92d0-4856-b421-d782467f393a}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="common_f2c.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="cshep2d.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="dspfit.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="somespline.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <f2c_rule Include="cshep2d.f">
-      <Filter>Fortran files</Filter>
-    </f2c_rule>
-    <f2c_rule Include="dspfit.f">
-      <Filter>Fortran files</Filter>
-    </f2c_rule>
-    <f2c_rule Include="somespline.f">
-      <Filter>Fortran files</Filter>
-    </f2c_rule>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="..\..\sci_gateway\interpolation_gateway.xml" />
-    <None Include="..\..\Makefile.am" />
-    <None Include="core_import.def">
-      <Filter>Libraries Dependencies</Filter>
-    </None>
-    <None Include="elementary_functions_f_Import.def">
-      <Filter>Libraries Dependencies</Filter>
-    </None>
-    <None Include="slatec_f_Import.def">
-      <Filter>Libraries Dependencies</Filter>
-    </None>
-  </ItemGroup>
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>\r
+    </Filter>\r
+    <Filter Include="Fortran files">\r
+      <UniqueIdentifier>{5bded6a7-2b35-4fd3-b2e1-ae7409e496aa}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Libraries Dependencies">\r
+      <UniqueIdentifier>{76cb8868-92d0-4856-b421-d782467f393a}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="common_f2c.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="cshep2d.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="dspfit.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="somespline.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="mesh2b.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <f2c_rule Include="cshep2d.f">\r
+      <Filter>Fortran files</Filter>\r
+    </f2c_rule>\r
+    <f2c_rule Include="dspfit.f">\r
+      <Filter>Fortran files</Filter>\r
+    </f2c_rule>\r
+    <f2c_rule Include="somespline.f">\r
+      <Filter>Fortran files</Filter>\r
+    </f2c_rule>\r
+    <f2c_rule Include="mesh2b.f">\r
+      <Filter>Fortran files</Filter>\r
+    </f2c_rule>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="..\..\sci_gateway\interpolation_gateway.xml" />\r
+    <None Include="..\..\Makefile.am" />\r
+    <None Include="core_import.def">\r
+      <Filter>Libraries Dependencies</Filter>\r
+    </None>\r
+    <None Include="elementary_functions_f_Import.def">\r
+      <Filter>Libraries Dependencies</Filter>\r
+    </None>\r
+    <None Include="slatec_f_Import.def">\r
+      <Filter>Libraries Dependencies</Filter>\r
+    </None>\r
+  </ItemGroup>\r
 </Project>
\ No newline at end of file
diff --git a/scilab/modules/interpolation/src/fortran/mesh2b.f b/scilab/modules/interpolation/src/fortran/mesh2b.f
new file mode 100644 (file)
index 0000000..deb00eb
--- /dev/null
@@ -0,0 +1,839 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution.  The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
+      subroutine mesh2b(nbs,n6,n4,lfront,cr,c,nu,tri,front,nbt,err)
+c-----------------------------------------------------------------------
+c triangulation  2d a partir d'un ensemble de points et d'une frontiere
+c de domaine decrite par ses composantes connexes
+c-----------------------------------------------------------------------
+c entrees :
+c     cr     tableau des coordonnees des points c(1:2,1:nbs)
+c     nbs    nombre de points
+c      n6=6*(nbs+nbs-2)       n4=4*nbs-4
+c     front  tableau definisant la frontiere par composantes connexes de la
+c            frontiere (i1,i2) front(i1)=front(i2) front(i+1) est le
+c            point frontiere suivant de front(i) pour i=i1,i2-1 telle que
+c            la normale a la frontiere soit interne ( la  composante
+c            connexe exterieure tourne dans le sens trigo )
+c     lfront est la longueur du tableau front
+c----------------------------------------------------------------------
+c tableaux de travail
+c     c(2,nbs) tableau d'entiers (copie de coordonnees)
+c     tri(4*nbs-4) tableau d'entiers
+c     nu (6*(2*nbs-2)) tableau d entiers contiendra le tableau
+c             des connectivites ( au debut) a la sortie du sp
+c
+c sorties :
+c     nbt         nombre de triangles generes
+c     nu(1:3,nbt) sommets des triangles (tableau des connections)
+c                        (!! nu a dimensionner en entree nu(1:6*(2*nbs-2))
+c     err         si err = 0 alors pas de probleme  (ok)
+c                        sinon nbt = 0 et pas de triangulation
+c     c(1:2,nbs)  coordonnees des sommets (en entier) cr n est pas modifie
+c---------------------------------------------------------------------------
+c hecht-marrocco  inria-rocquencourt  (39 63 55 14)
+c-------------------------------------------------------------------------
+      integer nbs,nbt,lfront,n6,n4,err
+      integer c(2,nbs),tri(n4),front(lfront),nu(n6)
+      double precision cr(2,nbs)
+      integer i,j,k,tete,i1,i2
+c
+      err = 0
+      nbt = 0
+      do 1,i=1,nbs
+         c(1,i)=0
+         c(2,i)=0
+ 1    continue
+      do 2,i=1,n6
+         nu(i)=0
+ 2    continue
+c preparation des donnees
+      call mshtri (cr,c,nbs,tri,tri(nbs+1),err)
+      if(err.ne.0) return
+c maillage de l enveloppe convexe
+      call mshcxi (c,nu,tri,nbs,tete,err,n4)
+      if(err.ne.0) return
+c
+      do 10 i=1,nbs
+      tri(i)=0
+10    continue
+      i=tete
+20    continue
+      j=nu(6*(i-1)+4)
+      tri(nu(6*(i-1)+1))=nu(6*(j-1)+1)
+      i=j
+      if(i.ne.tete) goto 20
+c traitement frontiere
+      k=0
+      if(lfront.gt.0) then
+      call mshfrt(c,nu,nbs,front,lfront,tri,err,n4)
+      if(err.ne.0) return
+      do 30 i=1,nbs
+      tri(i)=0
+30    continue
+      k  = 0
+      i2 = 0
+      do 40 i=1,lfront
+      i1=i2
+      i2=front(i)
+      if(i1.eq.k) then
+      k = -i2
+      elseif(i1.eq.-k) then
+      k=-k
+      tri(i1)=i2
+      else
+      tri(i1)=i2
+      endif
+40    continue
+      endif
+c     construction du tableau nu(1:3,1:nbt)
+      nbt=0
+      k = 0
+      do 200 j=1,6*(nbs+nbs-2),6
+      if(nu(j+5).ne.0) then
+      nbt=nbt + 1
+      do 190 i=0,2
+      k=k+1
+      nu(k)=nu(j+i)
+190   continue
+      endif
+200   continue
+      end
+c**********************************************************************
+      integer function mshlcl(c,nu,tete,s,nbs)
+      integer nbs,c(2,nbs),nu(6,nbs+nbs-2),tete,s
+      integer x,y,pt,ppt,det
+      logical init
+c
+      x=c(1,s)
+      y=c(2,s)
+      init=.true.
+      pt=tete
+10    continue
+      ppt=pt
+      pt=nu(4,pt)
+      if(pt.ne.tete) then
+      det=x*c(2,nu(1,pt)) -y*c(1,nu(1,pt))
+      if(det.lt.0) then
+      init=.false.
+      goto 10
+      elseif(init.and.det.eq.0) then
+      goto 10
+      endif
+      endif
+      mshlcl=ppt
+      end
+c**********************************************************************
+      subroutine mshtri (cr,c,nbs,tri,nu,err)
+      integer nbs,c(1:2,1:nbs),tri(1:nbs),nu(1:nbs),err
+      double precision cr(1:2,1:nbs)
+      integer iii,ic,xx,ip,i,j,jc,k,trik,tri3,det,ierr
+      double precision aa1,aa2,xmin,xmax,ymin,ymax
+      double precision precis
+      parameter (precis=2.**15-1.)
+c
+      err = 0
+      ierr = 0
+      iii=1
+      xmin=cr(1,1)
+      ymin=cr(2,1)
+      xmax=cr(1,1)
+      ymax=cr(2,1)
+      do 10 ic=1,nbs
+       xmin=min(cr(1,ic),xmin)
+       ymin=min(cr(2,ic),ymin)
+       xmax=max(cr(1,ic),xmax)
+       ymax=max(cr(2,ic),ymax)
+       tri(ic)=ic
+       if(cr(1,ic).lt.cr(1,iii)) then
+        iii=ic
+       endif
+10    continue
+      aa1 = precis/(xmax-xmin)
+      aa2 = precis/(ymax-ymin)
+      aa1 = min(aa1,aa2)
+      aa2 = aa1*(cr(2,iii)-ymin)
+      do 20 ic=1,nbs
+       c(1,ic) = nint(aa1*(cr(1,ic)-cr(1,iii)))
+       c(2,ic) = nint(aa1*(cr(2,ic)-ymin)-aa2)
+       nu(ic)= c(1,ic)**2 + c(2,ic)**2
+20    continue
+c----------------------------------------------------------
+      call mshtr1 (nu,tri,nbs)
+      ip = 1
+      xx=nu(ip)
+      do 30 jc=1,nbs
+      if(nu(jc).gt.xx)then
+      call mshtr1 (nu(ip),tri(ip),jc-ip)
+      do 25 i=ip,jc-2
+      if(nu(i).eq.nu(i+1)) then
+      ierr=ierr+1
+c      print *,' error les points ',tri(i),tri(i+1),' sont egaux'
+      endif
+25    continue
+      xx=nu(jc)
+      ip=jc
+      endif
+      ic=tri(jc)
+      nu(jc)=c(2,ic)
+30    continue
+      call mshtr1 (nu(ip),tri(ip),nbs-ip)
+      do 35 i=ip,jc-2
+      if(nu(i).eq.nu(i+1)) then
+      ierr=ierr+1
+c      print *,' error les points ',tri(i),tri(i+1),' sont egaux'
+      endif
+35    continue
+      if(ierr.ne.0) then
+      err = 2
+c      print *,' fatal error mshtri:il y a des points confondus'
+      return
+      endif
+      k=2
+50    continue
+      if(k.le.nbs) then
+      k=k+1
+      det = c(1,tri(2))*c(2,tri(k)) - c(2,tri(2))*c(1,tri(k))
+      if(det.eq.0) goto 50
+      else
+c      print *,'fatal error mshtri tous les points sont alignes'
+c      print *,'tri =',(tri(k),k=1,nbs)
+      err = 3
+      return
+      endif
+      trik = tri(k)
+      do 60 j=k-1,3,-1
+      tri(j+1)=tri(j)
+60    continue
+      tri(3)=trik
+      if(det.lt.0) then
+      tri3=tri(3)
+      tri(3)=tri(2)
+      tri(2)=tri3
+      endif
+      end
+c**********************************************************************
+      subroutine mshtr1 (criter,record,n)
+      integer record(n)
+      integer criter(n)
+c
+      integer i,l,r,j,n
+      integer rec
+      integer crit
+c
+      if(n.le.1) return
+      l=n/2+1
+      r=n
+2     if(l.le.1)goto 20
+      l=l-1
+      rec=record(l)
+      crit=criter(l)
+      goto 3
+20    continue
+      rec=record(r)
+      crit=criter(r)
+      record(r)=record(1)
+      criter(r)=criter(1)
+      r=r-1
+      if(r.eq.1)goto 999
+3     j=l
+4     i=j
+      j=2*j
+      CRES=j-r
+      if (CRES .lt. 0) then
+         goto 5
+      elseif (CRES .eq. 0) then
+         goto 6
+      else
+         goto 8
+      endif
+5     if(criter(j).lt.criter(j+1))j=j+1
+6     if(crit.ge.criter(j))goto 8
+      record(i)=record(j)
+      criter(i)=criter(j)
+      goto 4
+8     record(i)=rec
+      criter(i)=crit
+      goto 2
+999   record(1)=rec
+      criter(1)=crit
+      return
+      end
+c**********************************************************************
+      subroutine mshcvx(direct,c,nu,pfold,nbs,err)
+      integer nbs,c(2,nbs),nu(6,nbs+nbs-2),pfold,err
+      logical direct
+      integer pp,ps,i1,i2,i3,i4,i5,i6
+      integer pf,psf,ppf,s1,s2,s3,t,t4,t5,a4,a5,det,tt4,tt5
+      if(direct) then
+      pp=3
+      ps=4
+      i1=1
+      i2=3
+      i3=2
+      i4=6
+      i5=5
+      i6=4
+      else
+      pp=4
+      ps=3
+      i1=1
+      i2=2
+      i3=3
+      i4=4
+      i5=5
+      i6=6
+      endif
+10    continue
+      ppf=pfold
+      pf =nu(ps,pfold)
+      psf=nu(ps,pf)
+      s1=nu(1,ppf)
+      s2=nu(1,pf)
+      s3=nu(1,psf)
+      det =   ( c(1,s2) - c(1,s1) ) * ( c(2,s3) - c(2,s1) )
+     &      - ( c(2,s2) - c(2,s1) ) * ( c(1,s3) - c(1,s1) )
+      if(((.not.direct).and.det.gt.0).or.(direct.and.det.lt.0)) then
+      if(direct) then
+      tt4 = nu(2,ppf)
+      tt5 = nu(2,pf)
+      else
+      tt4 = nu(2,pf)
+      tt5 = nu(2,psf)
+      endif
+      t4 = tt4/(2**3)
+      t5 = tt5/(2**3)
+      a4 = tt4 -8 * t4
+      a5 = tt5 -8 * t5
+      nu(ps,ppf) = psf
+      nu(pp,psf) = ppf
+      t = pf
+      if(direct) then
+      nu(2,ppf) = (2**3) * t + i6
+      else
+      nu(2,psf) = (2**3) * t + i6
+      endif
+      nu(i1,t ) = s1
+      nu(i2,t ) = s2
+      nu(i3,t ) = s3
+      nu(i4,t ) = (2**3) * t4 + a4
+      nu(i5,t ) = (2**3) * t5 + a5
+      if(direct) then
+      nu(i6,t ) = -ppf
+      else
+      nu(i6,t ) = -psf
+      endif
+      nu(a4,t4) = (2**3) * t + i4
+      nu(a5,t5) = (2**3) * t + i5
+      call mshopt (c,nu,t5,a5,nbs,err)
+      if(err.ne.0) return
+      goto 10
+      endif
+      end
+c**********************************************************************
+      subroutine mshcxi (c,nu,tri,nbs,tete,err,n4)
+      integer nbs,c(2,nbs),nu(6,2*nbs-2),tri(n4),tete
+      integer mshlcl,err,n4
+      integer i,j,s,t,pf,ppf,psf,npf,pp,ps,taf,iaf,free,ttaf
+      parameter (pp=3,ps=4)
+      do 10 i=1,nbs+nbs-2
+      nu(1,i)=i+1
+      do 10 j=2,6
+      nu(j,i)=0
+10    continue
+      nu(1,nbs+nbs-2)=0
+      free = 1
+      t=free
+      free = nu(1,free)
+      tete=free
+      pf  =free
+      do 20 i=1,3
+      nu(i  ,t) = tri(i)
+      nu(3+i,t) = -pf
+      ppf       = pf
+      free      = nu(1,pf)
+      pf        = free
+      if(i.eq.3) pf=tete
+      nu(1,ppf) = tri(i)
+      nu(2,ppf) = i + 3 + (2**3) * t
+      nu(ps,ppf) = pf
+      nu(pp,pf ) = ppf
+20    continue
+      do 30 i=4,nbs
+      s=tri(i)
+      pf=mshlcl(c,nu,tete,s,nbs)
+      t=free
+      free = nu(1,free)
+      npf  = free
+      free = nu(1,free)
+      ppf  = nu(pp,pf)
+      psf  = nu(ps,pf)
+      ttaf  = nu(2,pf)
+      taf  = ttaf / (2**3)
+      iaf  = ttaf - (2**3) * taf
+      nu(1,t) = s
+      nu(2,t) = nu(1,psf)
+      nu(3,t) = nu(1,pf )
+      nu(4,t) = -npf
+      nu(5,t) = (2**3) * taf + iaf
+      nu(6,t) = -pf
+      nu(iaf,taf) = (2**3) * t + 5
+      nu(ps,npf) = psf
+      nu(ps,pf ) = npf
+      nu(pp,npf) = pf
+      nu(pp,psf) = npf
+      nu(1,npf)  = s
+      nu(2,npf)  = (2**3) * t + 4
+      nu(2,pf )  = (2**3) * t + 6
+      call mshopt (c,nu,t,5,nbs,err)
+      if(err.ne.0) return
+      call mshcvx (.true. ,c,nu,npf,nbs,err)
+      if(err.ne.0) return
+      call mshcvx (.false.,c,nu,npf,nbs,err)
+      if(err.ne.0) return
+30    continue
+      end
+c**********************************************************************
+      subroutine mshopt (c,nu,t,a,nbs,err)
+      integer nbs,c(2,nbs),nu(6,nbs+nbs-2),t,a,err
+      integer vide
+      parameter (vide=-2**30)
+      integer mxpile
+      parameter (mxpile=512)
+      integer pile(2,mxpile)
+      integer t1,t2,i,s1,s2,s3,s4,sin1,cos1,sin2,cos2,sgn
+      integer tt1,tt,i11,i12,i13,i21,i22,i23,a1,a2,aa,mod3(1:3)
+      double precision reel1,reel2
+      double precision reel8
+      data mod3/2,3,1/
+      i=1
+      pile(1,i) = t 
+      pile(2,i) = a
+10    continue
+      if(i.gt.0) then
+      t1=pile(1,i)
+      a1=pile(2,i)
+      i=i-1
+      if(t1.le.0) goto 10
+      tt1 = nu(a1,t1)
+      if(tt1.le.0) goto 10
+      t2 = tt1/(2**3)
+      a2 = tt1-t2*(2**3)
+      i11 =   a1 -3
+      i12 =   mod3(i11) 
+      i13 =   mod3(i12)
+      i21 =   a2 -3
+      i22 =   mod3(i21)
+      i23 =   mod3(i22)
+      s1 = nu(i13,t1)
+      s2 = nu(i11,t1)
+      s3 = nu(i12,t1)
+      s4 = nu(i23,t2)
+        sin1 =   (c(2,s3)-c(2,s1)) * (c(1,s2)-c(1,s1))
+     &         - (c(1,s3)-c(1,s1)) * (c(2,s2)-c(2,s1))
+        cos1 =   (c(1,s3)-c(1,s1)) * (c(1,s3)-c(1,s2))
+     &         + (c(2,s3)-c(2,s1)) * (c(2,s3)-c(2,s2))
+        if(sin1.eq.0.and.cos1.eq.0) then
+c          print *,'fatal error mshopt:'
+c     &           ,'3 points confondus ',s1,s2,s3
+          err = 12
+          return
+        end if
+        sin2  =   (c(1,s4)-c(1,s1)) * (c(2,s2)-c(2,s1))
+     &          - (c(2,s4)-c(2,s1)) * (c(1,s2)-c(1,s1))
+        cos2  =   (c(1,s4)-c(1,s2)) * (c(1,s4)-c(1,s1))
+     &          + (c(2,s4)-c(2,s2)) * (c(2,s4)-c(2,s1))
+        reel1=float(cos2)*float(sin1)
+        reel2=float(cos1)*float(sin2)
+        if(abs(reel1)+abs(reel2).ge.2**30) then
+        reel8=dble(cos2)*dble(sin1)
+     &       +dble(cos1)*dble(sin2)
+        reel8=min(max(reel8,-1.d0),1.d0)
+        sgn=reel8
+        else
+        sgn = cos2*sin1 + cos1*sin2
+        endif
+        if(min(max(sgn,-1),+1)*sin1.ge.0) goto 10
+        nu(i12,t1) = s4
+        nu(i22,t2) = s1
+        tt1 = nu(i22+3,t2)
+        nu(a1 ,t1) = tt1
+        if(tt1.gt.0) then
+         tt=tt1/(2**3)
+         aa = tt1-(2**3)*tt
+         nu(aa,tt)=  a1 +  (2**3) * t1
+        elseif(tt1.ne.vide) then
+         nu(2,-tt1)= a1 +  (2**3) * t1
+        endif
+        tt1 = nu(i12+3,t1)
+        nu(a2 ,t2) = tt1
+        if(tt1.gt.0) then
+         tt=tt1/(2**3)
+         aa=tt1-(2**3)*tt
+         nu(aa,tt)= a2 +  (2**3) * t2
+        elseif(tt1.ne.vide) then
+         nu(2,-tt1)= a2 +  (2**3) * t2
+        endif
+        nu(i12+3,t1) =   i22+3 + (2**3)*t2
+        nu(i22+3,t2) =   i12+3 + (2**3)*t1
+        if(i+4.gt.mxpile) then
+c          print *,' fatal error mshopt la pile est trop petite ',mxpile
+          err =13
+          return
+        endif
+c
+        i=i+1
+        pile(1,i)=t1
+        pile(2,i)=a1
+        i=i+1
+        pile(1,i)=t2
+        pile(2,i)=a2
+        i=i+1
+        pile(1,i)=t1
+        pile(2,i)=i13+3
+        i=i+1
+        pile(1,i)=t2
+        pile(2,i)=i23+3
+        goto 10
+      endif
+      end
+c**********************************************************************
+      subroutine mshfrt (c,nu,nbs,frt,lfrt,w,err,n4)
+      integer nbs,c(2,nbs),nu(6,nbs+nbs-2)
+      integer lfrt,frt(lfrt),err,w(n4)
+      integer i,ifrt,sinit,lnu,is,ie,tinter,nbac,nbaf,nbacpp
+      integer s0,s1,s2,ta,is1,it,s2t,s3t,det2,det3
+      integer p3(1:3)
+      integer vide
+      parameter (vide=-2**30)
+      logical fin
+      data p3/2,3,1/
+      if(lfrt.eq.0) return
+      tinter =0
+      ifrt=0
+      lnu = nbs+nbs-2
+c       inite du tableau w
+      do 10 i=1,nbs
+       w(i)=-1
+10    continue
+      nbaf = 0
+      s1 = 0
+      sinit= 0
+      fin =.true.
+      do 20 i=1,lfrt
+      s0 = s1
+      s1 = frt(i)
+      if(s1.le.0.or.s1.gt.nbs) then
+      err=5
+c      print *,' fatal error mshfrt '
+c      print *,' le tableau des la frontiere est mauvais en ',i,s1
+      return
+      endif
+      if(s0.eq.sinit) then
+      if(fin) then
+      sinit=s1
+      else
+      nbaf = nbaf + 1
+      if(w(s0).ne.-1) then
+c      print *,'fatal error mshfrt : la frontiere est croisee '
+c     &       ,' en ',s0                    
+      err=6
+      endif
+      w(s0)=i
+      endif
+      fin=.not.fin
+      else
+      nbaf = nbaf + 1
+      if(w(s0).ne.-1) then
+c      print *,'fatal error mshfrt : la frontiere est croisee '
+c     &       ,' en ',s0                    
+      err=6
+      endif
+      w(s0)=i
+      endif
+20    continue
+      if(sinit.ne.s1) then
+c      print *,'warning mshfrt:la frontiere n''est pas fermee'
+c     &         ,' on la ferme avec l''arete ',s1,sinit
+      if(w(s1).ne.-1) then
+c      print *,'fatal error mshfrt : la frontiere est croisee '
+c     &           ,' en ',s1
+      err=6
+      endif
+      w(s1)=sinit
+      nbaf = nbaf + 1
+      endif
+      nbac = 0
+      nbacpp = 1
+30    continue
+      if(err.ne.0) return
+      if(nbac.lt.nbaf) then
+      if(nbacpp.eq.0) then
+      err = 7
+c      print *,' fatal error mshfrt :l''algorithme boucle :'
+c     &           ,nbaf,nbac
+c      print *,' la frontiere est certainement mal orientee '
+      return
+      endif
+c     on s'occupe des aretes du maillage et frontiere de omega
+c---------------------------------------------------------------------
+      nbacpp = 0
+      do 60 ie=1,lnu
+      if(nu(5,ie).ne.0) then
+      do 50 is=1,3
+      s1  =nu(    is ,ie)
+      s2t =nu( p3(is),ie)
+      if(w(s1).gt.0) then
+      s2   = frt(w(s1))
+      if(s2.eq.s2t) then
+      tinter = ie
+      nbacpp = nbacpp + 1 
+      w(s1) = 0
+      if(nu(is+3,ie).gt.0) then
+      ta = nu(is+3,ie) /(2**3)
+      i  = nu(is+3,ie)-(2**3) * ta
+      nu(i,ta)=vide
+      endif
+      nu(is+3,ie)=vide
+      else
+      it   = ie
+      is1  = is
+      s3t  = nu(p3(p3(is)),it)
+      det2 =  (c(1,s2t)-c(1,s1))*(c(2,s2)-c(2,s1))
+     &      - (c(2,s2t)-c(2,s1))*(c(1,s2)-c(1,s1))
+      det3 =  (c(1,s3t)-c(1,s1))*(c(2,s2)-c(2,s1))
+     &      - (c(2,s3t)-c(2,s1))*(c(1,s2)-c(1,s1))
+      if(det2.ge.0.and.det3.le.0) then
+      if(det2.eq.0) then
+      if(w(s2t).eq.-1) then
+      print *,' fatal error mshfrt: le point ',s2t
+     &       ,' qui ne doit pas etre frontiere , l''est'
+      err = 10
+      endif
+      goto 50
+      endif
+      if(det3.eq.0) then
+      if(w(s3t).eq.-1) then
+      print *,' fatal error mshfrt: le point ',s3t
+     &      ,' qui ne doit pas etre frontiere , l''est'
+      err = 10
+      endif
+      goto 50
+      endif
+      call mshfr1 (c,nu,nbs,it,is1,s2,err)
+      if(err.ne.0) return
+      tinter=it
+      w(s1) = 0
+      nbacpp = nbacpp + 1
+      endif
+      endif
+      endif
+50    continue
+      endif
+60    continue
+      nbac = nbac + nbacpp
+      goto 30
+      endif
+      i=2
+      w(1)=tinter
+      w(2)=3
+      nu(1,tinter) = -nu(1,tinter)
+70    continue
+      if(i.gt.0) then
+      w(i)=w(i)+1
+      if(w(i).le.6) then
+      ta=nu(w(i),w(i-1))
+      if(ta.gt.0) then
+      ta = ta / (2**3)
+      if(nu(1,ta).gt.0) then
+      w(i+1)=ta
+      w(i+2)=3
+      i=i+2
+      nu(1,ta)=-nu(1,ta)
+      endif
+      endif
+      else
+      i=i-2
+      endif
+      goto  70
+      endif
+      do 90 ie=1,lnu
+      if(nu(1,ie).lt.0) then
+      nu(1,ie)=-nu(1,ie)
+      else
+      do 80 i=1,6
+      nu(i,ie)=0
+80    continue
+      endif
+90    continue
+      end
+c**********************************************************************
+      subroutine mshfr1 (c,nu,nbs,it1,is1,s2,err)
+      integer nbs,c(2,nbs),nu(6,nbs+nbs-2),is1,s2,err,it1
+      integer lstmx
+      parameter (lstmx=256)
+      integer lst(3,lstmx)
+      integer s1,s3,x,y,det,nbac,s2t,s3t,t,ta
+      integer l1,l2,l3,la,p3(1:5)
+      logical direct
+      data p3 /2,3,1,2,3/
+      direct = .true.
+      t = it1
+      s1 = nu(is1,t)
+      x = c(1,s2)-c(1,s1)
+      y = c(2,s2)-c(2,s1)
+      nbac = 0
+      l1 = is1
+      l2 = p3(l1)
+      l3 = p3(l2)
+      s2t = nu(l2,t)
+      s3t = nu(l3,t)
+      la = l2 + 3
+20    continue
+      nbac = nbac + 1
+      if(nbac.gt.lstmx) then
+        print *,' fatal error mshfr1 : lst trop petit ',nbac,lstmx
+        err =8
+        return
+      endif
+      lst(2,nbac) = t
+      lst(3,nbac) = la
+      ta = nu(la,t)
+      if(ta.le.0) then
+        print *,' fatal error mshfr1:la frontiere est croisee en ',t
+        err =9
+        return
+      endif
+      t  = ta/8
+      la = ta-8*t 
+      s3 = nu(p3(la-2),t)
+      if(s3.ne.s2) then
+        det = x*(c(2,s3)-c(2,s1))-y*(c(1,s3)-c(1,s1))
+        if(det.gt.0) then
+          la = 3+p3(la-3)
+        elseif(det.lt.0) then
+          la = 3+p3(la-2)
+        else
+          print *,' fatal error mshfr1: le point ',s3
+     &           ,' qui ne doit pas etre frontiere , l''est'
+          err = 10
+          return
+        endif
+        goto 20
+      endif
+      call mshfr2 (c,nu,nbs,lst,nbac,it1,s1,s2)
+      return
+      end
+c**********************************************************************
+      subroutine mshfr2 (c,nu,nbs,lst,nbac,t,ss1,ss2)
+      integer nbs,nbac,c(2,nbs),nu(6,nbs+nbs-2),lst(3,nbac)
+      integer t,ss1,ss2
+      integer ptlst,ttlst,pslst,pplst,s1,s2,s3,s4,x41,y41,x,y
+      integer i,t1,a1,tt1,t2,a2,tt,i11,i12,i13,i21,i22,i23,aas,aa
+      integer det1,det4,det2,det3
+      integer mod3(3)
+      integer vide
+      parameter (vide=-2**30)
+      data mod3/2,3,1/
+      x = c(1,ss1)-c(1,ss2)
+      y = c(2,ss1)-c(2,ss2)
+      do 10 i=1,nbac-1
+      lst(1,i)=i+1
+10    continue
+      lst(1,nbac)=0
+      ttlst = 1
+20    continue
+      ptlst  = ttlst
+      pplst  = 0
+30    continue
+      if(ptlst.gt.0) then
+      t1=lst(2,ptlst)
+      a1=lst(3,ptlst)
+      tt1 = nu(a1,t1)
+      t2 = tt1/(2**3)
+      a2 = tt1-t2*(2**3)
+      i11 =   a1 -3
+      i12 =   mod3(i11) 
+      i13 =   mod3(i12)
+      i21 =   a2 -3
+      i22 =   mod3(i21)
+      i23 =   mod3(i22)
+      s1 = nu(i13,t1)
+      s2 = nu(i11,t1)
+      s3 = nu(i12,t1)
+      s4 = nu(i23,t2)
+      x41 = c(1,s4)-c(1,s1)
+      y41 = c(2,s4)-c(2,s1)
+      det2 = (c(1,s2)-c(1,s1))*y41-(c(2,s2)-c(2,s1))*x41
+      det3 = (c(1,s3)-c(1,s1))*y41-(c(2,s3)-c(2,s1))*x41
+      if(det2.gt.0.and.det3.lt.0) then
+      nu(i12,t1) = s4
+      nu(i22,t2) = s1
+      pslst=lst(1,ptlst)
+      if(pslst.gt.0) then
+      aas=lst(3,pslst)
+      if(aas.eq.i22+3) then
+      lst(2,pslst) = t1
+      lst(3,pslst) = i11 + 3
+      endif
+      endif
+      tt1 = nu(i22+3,t2)
+      nu(a1 ,t1) = tt1
+      if(tt1.gt.0) then
+      tt=tt1/(2**3)
+      aa = tt1-(2**3)*tt
+      nu(aa,tt)=  a1 +  (2**3) * t1
+      elseif(tt1.ne.vide) then
+      nu(2,-tt1)= a1 +  (2**3) * t1
+      endif
+      tt1 = nu(i12+3,t1)
+      nu(a2 ,t2) = tt1
+      if(tt1.gt.0) then
+      tt=tt1/(2**3)
+      aa=tt1-(2**3)*tt
+      nu(aa,tt)= a2 +  (2**3) * t2
+      elseif(tt1.ne.vide) then
+      nu(2,-tt1)= a2 +  (2**3) * t2
+      endif
+      nu(i12+3,t1) =   i22+3 + (2**3)*t2
+      nu(i22+3,t2) =   i12+3 + (2**3)*t1
+      det1 = (c(1,s1)-c(1,ss1))*y-(c(2,s1)-c(2,ss1))*x
+      det4 = (c(1,s4)-c(1,ss1))*y-(c(2,s4)-c(2,ss1))*x
+      if(det1.lt.0.and.det4.gt.0) then
+      lst(2,ptlst) = t2
+      lst(3,ptlst) = i22+3
+      elseif(det1.gt.0.and.det4.lt.0) then
+      lst(2,ptlst) = t1
+      lst(3,ptlst) = i12+3
+      else
+      if(pplst.eq.0) then
+      ttlst = lst(1,ptlst)
+      ptlst = ttlst
+      else
+      ptlst        = lst(1,ptlst)
+      lst(1,pplst) = ptlst
+      endif
+      goto 30
+      endif
+      endif
+      pplst = ptlst
+      ptlst = lst(1,ptlst)
+      goto 30
+      endif
+      if(ttlst.ne.0) goto 20
+      nu(i12+3,t1) =  vide
+      nu(i22+3,t2) =  vide
+      t = t2      
+      do 40 i=1,nbac
+      call mshopt (c,nu,lst(2,i),4,nbs,ierr)
+      call mshopt (c,nu,lst(2,i),5,nbs,ierr)
+      call mshopt (c,nu,lst(2,i),6,nbs,ierr)
+40    continue
+      end 
diff --git a/scilab/modules/interpolation/tests/unit_tests/mesh2d.tst b/scilab/modules/interpolation/tests/unit_tests/mesh2d.tst
new file mode 100644 (file)
index 0000000..2155815
--- /dev/null
@@ -0,0 +1,35 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2018 - Stéphane MOTTELET
+//
+//, This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+// <-- NO CHECK REF -->
+
+[x,y] = meshgrid(1:4,1:3);
+
+// Test returned boundary
+tri1_1 = [1, 5, 8, 7, 3, 8, 10, 6, 9, 10, 11, 12
+4, 2, 5, 5, 2, 6, 11, 3, 6, 8, 9, 9 
+2, 4, 7, 4, 5, 5, 8, 5, 8, 7, 8, 11];
+[tri1_2, cv_hull_1] = mesh2d(x(:), y(:));
+assert_checkequal(cv_hull_1, [1, 4, 7, 10, 11, 12, 9, 6, 3, 2, 1]');
+assert_checkequal(tri1_1, tri1_2);
+
+// Test with non-convex boundary
+tri2_1 = [1, 5, 3, 8, 10, 6, 9, 10, 11, 12.
+4, 2, 2, 6, 11, 3, 6, 8, 9, 9. 
+2, 4, 5, 5, 8, 5, 8, 7, 8, 11];
+tri2_2 = mesh2d(x(:),y(:), [1, 4, 5, 8, 7, 10, 11, 12, 9, 6, 3, 2, 1]);
+assert_checkequal(tri2_1, tri2_2);
+
+// Test with hole
+[x,y]=meshgrid(1:4,1:4);
+[tri3_1, cv_hull_3] = mesh2d(x(:), y(:));
+tri3_2 = mesh2d(x(:), y(:), [cv_hull_3; 6; 10; 11; 7; 6]);
+tri3_3 = [1, 6, 10, 9, 3, 13, 7, 8, 15, 13, 4, 14, 8, 15, 12, 16
+5, 2, 6, 6, 2, 14, 3, 7,  12, 10, 3, 11, 4, 11, 8,  12
+2, 5, 9, 5, 6, 10, 6, 11, 11, 9, 7, 10, 7, 14, 11, 15];
+assert_checkequal(tri3_2, tri3_3);