Cedric Delamarre [Wed, 15 May 2013 10:25:51 +0000 (12:25 +0200)]
Change-Id: Ie1fde67377499a09ebd835a155469f340a5a0052

 scilab/modules/integer/macros/%i_i_i.sci [moved from scilab/modules/overloading/macros/%i_i_i.sci with 57% similarity] patch | blob | history

similarity index 57%
rename to scilab/modules/integer/macros/%i_i_i.sci
index 2bccf36..603aa4b 100644 (file)
@@ -7,21 +7,16 @@
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt

-function M=%i_i_i(varargin)
-//- insertion of an integer matrix in an matrix of integers
+function left=%i_i_i(varargin)
+//- insertion of an integer matrix in an matrix of integers
//            for more than 2 indices
// -insertion an integer matrix in an integer matrix which has a
//            different integer type
-  rhs=argn(2)
-  M=varargin(rhs)
-  it=inttype(M)
-  M=mlist(['hm','dims','entries'],int32(size(M)),M(:))
-  varargin(rhs)=M;
-
-  if it<>inttype(varargin(rhs-1)) then
-    //different integer types (should be hard coded)
-    varargin(rhs-1)=iconvert(varargin(rhs-1),it)
-  end

-  M=generic_i_hm(iconvert(0,it),varargin(:))
+    left  = varargin(\$);
+    rigth = varargin(\$-1);
+
+    rigth = iconvert(rigth, inttype(left));
+
+    left(varargin(1:\$-2)) = rigth;
endfunction