[elementary_functions] linspace() c++ gateway gives tremendous speedup 85/20685/4
authorStéphane MOTTELET <stephane.mottelet@utc.fr>
Fri, 19 Oct 2018 21:48:38 +0000 (23:48 +0200)
committerClément DAVID <clement.david@esi-group.com>
Wed, 20 Nov 2019 16:56:42 +0000 (17:56 +0100)
commitc1f299d7479323d2928302da8de3a7a81bbbfee0
treec85ccb49f2fda5114f4662dc2895904dd334ede9
parentd79ab01128a04f7776503d4f3b7a5e250a113c34
[elementary_functions] linspace() c++ gateway gives tremendous speedup

40x speedup for typical sizes:

Scilab 6.0.1:
--> tic;for i=1:100000;linspace(0,2*%pi,1000);end;toc()
 ans  =
   20.667936

Scilab master:
--> tic;for i=1:100000;linspace(0,2*%pi,1000);end;toc()
 ans  =
   0.476891

and linear interpolation between arrays of any dimensions, e.g.

--> linspace(rand(2,2),rand(2,2),5)
 ans  =

(:,:,1)

   0.8782165   0.5608486
   0.068374    0.6623569
(:,:,2)

   0.84025     0.5567008
   0.1009091   0.5547864
(:,:,3)

   0.8022836   0.552553
   0.1334442   0.4472159
(:,:,4)

   0.7643171   0.5484051
   0.1659793   0.3396453
(:,:,5)

   0.7263507   0.5442573
   0.1985144   0.2320748

Change-Id: I81362a2d858f1a465f4becc6ae8a29aea4dbda28
scilab/modules/elementary_functions/Makefile.am
scilab/modules/elementary_functions/Makefile.in
scilab/modules/elementary_functions/help/en_US/elementarymatrices/linspace.xml
scilab/modules/elementary_functions/includes/elem_func_gw.hxx
scilab/modules/elementary_functions/macros/%i_linspace.sci [moved from scilab/modules/elementary_functions/macros/linspace.sci with 72% similarity]
scilab/modules/elementary_functions/sci_gateway/cpp/elem_func_gw.cpp
scilab/modules/elementary_functions/sci_gateway/cpp/elem_func_gw/elem_func_gw.vcxproj
scilab/modules/elementary_functions/sci_gateway/cpp/sci_linspace.cpp [new file with mode: 0644]