scilab: rollback on sciint CreateMagtrixOfDoubleAsInteger does not exist in 5.3.3
This commit is contained in:
parent
7f32e10b61
commit
01cf2e3308
1 changed files with 10 additions and 1 deletions
|
|
@ -174,12 +174,21 @@ SWIG_SciDoubleOrInt32_AsIntArrayAndSize(void *_pvApiCtx, int _iVar, int *_iRows,
|
||||||
SWIGINTERN int
|
SWIGINTERN int
|
||||||
SWIG_SciDouble_FromIntArrayAndSize(void *_pvApiCtx, int _iVarOut, int _iRows, int _iCols, const int *_piData) {
|
SWIG_SciDouble_FromIntArrayAndSize(void *_pvApiCtx, int _iVarOut, int _iRows, int _iCols, const int *_piData) {
|
||||||
SciErr sciErr;
|
SciErr sciErr;
|
||||||
sciErr = createMatrixOfDoubleAsInteger(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, _iRows, _iCols, _piData);
|
double *pdValues = NULL;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
pdValues = (double*) malloc(_iRows * _iCols * sizeof(double));
|
||||||
|
for (i=0; i<_iRows * _iCols; i++)
|
||||||
|
pdValues[i] = _piData[i];
|
||||||
|
|
||||||
|
sciErr = createMatrixOfDouble(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, _iRows, _iCols, pdValues);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
|
free(pdValues);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(pdValues);
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue