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:
parent
9e57bfd84a
commit
613d1a1a8d
3 changed files with 17 additions and 13 deletions
|
|
@ -1,17 +1,6 @@
|
|||
%module matrixlib
|
||||
%typemap (in,noblock=1) (double *first, int nbRow, int nbCol){
|
||||
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;
|
||||
}
|
||||
}
|
||||
%include "matrix.i"
|
||||
extern double sumitems(double *, int, int);
|
||||
%typemap (in) (int *numberOfRow, int *numberOfCol) {
|
||||
$1 = &iRowsOut;
|
||||
$2 = &iColsOut;
|
||||
|
|
|
|||
13
Lib/scilab/matrix.i
Normal file
13
Lib/scilab/matrix.i
Normal 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -2167,3 +2167,5 @@
|
|||
* ------------------------------------------------------------ */
|
||||
|
||||
%apply int { size_t };
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue