Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - 日本語

Scilab 6.1.0
Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.

Scilabヘルプ >> API Scilab > legacy > Low level functions > ハンドルの書き込み (Scilab ゲートウェイ)

ハンドルの書き込み (Scilab ゲートウェイ)

ハンドルの行列を書き込む方法.

呼び出し手順

入力引数プロファイル:

SciErr createMatrixOfHandle(void* _pvCtx, int _iVar, int _iRows, int _iCols, const long long* _pllHandle)

引数

_pvCtx

Scilab環境ポインタ, api_scilab.h により定義された "pvApiCtx"で指定.

_iVar

変数を保存するScilabメモリの位置.

_piRows

返される変数の行数.

_piCols

返される変数の列数.

_pllHandle

返されるデータ配列のアドレス (大きさ: _iRows * _iCols).

SciErr

エラー構造体で,エラーメッセージ履歴と最初のエラー番号を格納します.

Scilabメモリに直接書き込み.

呼び出し手順

入力引数プロファイル:

SciErr allocMatrixOfHandle(void* _pvCtx, int _iVar, int _iRows, int _iCols, long long** _pllHandle)

引数

_pvCtx

Scilab環境ポインタ, api_scilab.h により定義された "pvApiCtx"で指定.

_iVar

変数を保存するScilabメモリの位置.

_iRows

新規変数の行数.

_iCols

新規変数の列数.

_pllHandle

実数データ配列のアドレスを返す (大きさ: _iCols * _iRows).

SciErr

エラー構造体で,エラーメッセージ履歴と最初のエラー番号を格納します.

説明

このヘルプはハンドルの行列を書き込む方法を示します.

ゲートウェイのソース

#include "api_scilab.h"
int read_write_handle(char *fname,void* pvApiCtx)
{
    SciErr sciErr;
    int i;
    //最初の変数の情報 : double実数行列
    int iRows       = 0;
    int iCols       = 0;
    int *piAddr     = NULL;
    long long* pllHandle   = NULL;
    //入力/出力引数を確認
    CheckInputArgument(pvApiCtx, 1,1);
    CheckOutputArgument(pvApiCtx, 0,1);
    //最初の入力引数の変数アドレスを取得
    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
    if(sciErr.iErr)
    {
        printError(&sciErr, 0);
        return 0;
    }
    // Scilabメモリから大きさとデータを取得
    sciErr = getMatrixOfHandle(pvApiCtx, piAddr, &iRows, &iCols, &pllHandle);
    if(sciErr.iErr)
    {
        printError(&sciErr, 0);
        return 0;
    }
    sciErr = createMatrixOfHandle(pvApiCtx, nbInputArgument(pvApiCtx) + 1, iRows, iCols, pllHandle);
    if(sciErr.iErr)
    {
        printError(&sciErr, 0);
        return 0;
    }
    AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
    return 0;
}

Scilab テストスクリプト

f1 = scf(1);
f2 = scf(2);
a_ref = [f1, f2];
b = read_write_handle(a_ref);
if or(b <> a_ref) then error("failed"), end

履歴

VersionDescription
5.5.0 この関数は Scilab 5.5.0で追加されました
Report an issue
<< ハンドルの読み込み (Scilab ゲートウェイ) Low level functions 整数の精度 (Scilabゲートウェイ) >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:53:30 CET 2020