getHypermatOfDouble
double変数のハイパー行列を取得.
呼び出し手順
SciErr getHypermatOfDouble(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, double* _pdblReal)
引数
- _pvCtx
Scilab環境ポインタ, api_scilab.h により定義された "pvApiCtx"で指定.
- _piAddress
Scilab 変数のアドレス.
- _dims
ハイパー行列の次元
- _ndims
次元の数.
- _pdblReal
double値.
戻り値
SciErr構造体, フィールド iErr は エラー番号を保持します (エラーがない場合は 0).
ゲートウェイのソース
#include "api_scilab.h" int hypermatExample(char *fname, void* pvApiCtx) { SciErr sciErr; int* piAddr = NULL; int iType = 0; int iRet = 0; CheckInputArgument(pvApiCtx, 1, 1); CheckOutputArgument(pvApiCtx, 0, 1); sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr); if (sciErr.iErr) { printError(&sciErr, 0); return 0; } if (isEmptyMatrix(pvApiCtx, piAddr)) { iRet = createEmptyMatrix(pvApiCtx, nbInputArgument(pvApiCtx) + 1); if (iRet) { return iRet; } AssignOutputVariable(pvApiCtx, 1) = 0; } else if (isHypermatType(pvApiCtx, piAddr)) { int * dims = NULL; int ndims; double* pdblReal = NULL; double* pdblImg = NULL; if (isHypermatComplex(pvApiCtx, piAddr)) { sciErr = getComplexHypermatOfDouble(pvApiCtx, piAddr, &dims, &ndims, &pdblReal, &pdblImg); if (sciErr.iErr) { printError(&sciErr, 0); return sciErr.iErr; } sciErr = createComplexHypermatOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, dims, ndims, pdblReal, pdblImg); if (sciErr.iErr) { printError(&sciErr, 0); return sciErr.iErr; } } else { sciErr = getHypermatOfDouble(pvApiCtx, piAddr, &dims, &ndims, &pdblReal); if (sciErr.iErr) { printError(&sciErr, 0); return sciErr.iErr; } sciErr = createHypermatOfDouble(pvApiCtx, nbInputArgument(pvApiCtx) + 1, dims, ndims, pdblReal); if (sciErr.iErr) { printError(&sciErr, 0); return sciErr.iErr; } } AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1; } return 0; }
Scilab テストスクリプト
Report an issue | ||
<< isHypermatType | hypermat | getHypermatOfInt >> |