add matrix.i

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11893 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Baozeng Ding 2010-03-03 11:39:17 +00:00
commit 613d1a1a8d
3 changed files with 17 additions and 13 deletions

View file

@ -1,17 +1,6 @@
%module matrixlib %module matrixlib
%typemap (in,noblock=1) (double *first, int nbRow, int nbCol){ %include "matrix.i"
int *piAddr = NULL; extern double sumitems(double *, int, int);
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &$2, &$3, &$1);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
}
%typemap (in) (int *numberOfRow, int *numberOfCol) { %typemap (in) (int *numberOfRow, int *numberOfCol) {
$1 = &iRowsOut; $1 = &iRowsOut;
$2 = &iColsOut; $2 = &iColsOut;

13
Lib/scilab/matrix.i Normal file
View file

@ -0,0 +1,13 @@
%typemap(in) (double*, int, int) {
int *piAddr = NULL;
sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &$2, &$3, &$1);
if (sciErr.iErr) {
printError(&sciErr, 0);
return 0;
}
}

View file

@ -2167,3 +2167,5 @@
* ------------------------------------------------------------ */ * ------------------------------------------------------------ */
%apply int { size_t }; %apply int { size_t };