~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/api_scilab/help/en_US/low_level_functions/bsparse_writing_api.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 *
12
12
 -->
13
13
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="bsparse_writing_API" xml:lang="en">
14
 
  <refnamediv>
15
 
    <refname>Boolean sparse writing (Scilab gateway)</refname>
16
 
    <refpurpose>
17
 
      How to add boolean sparse matrix in a gateway.
18
 
    </refpurpose>
19
 
  </refnamediv>
20
 
  <refsynopsisdiv>
21
 
    <title>Calling Sequence</title>
22
 
    <para>Input argument profile:</para>
23
 
    <synopsis>SciErr createBooleanSparseMatrix(void* _pvCtx, int _iVar, int _iRows, int _iCols, int _iNbItem, const int* _piNbItemRow, const int* _piColPos)</synopsis>
24
 
    <para>Named variable profile:</para>
25
 
    <synopsis>SciErr createNamedBooleanSparseMatrix(void* _pvCtx, const char* _pstName, int _iRows, int _iCols, int _iNbItem, const int* _piNbItemRow, const int* _piColPos)</synopsis>
26
 
  </refsynopsisdiv>
27
 
  <refsection>
28
 
    <title>Arguments</title>
29
 
    <variablelist>
30
 
      <varlistentry>
31
 
        <term>_pvCtx</term>
32
 
        <listitem>
33
 
          <para>
34
 
            Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h.
35
 
          </para>
36
 
        </listitem>
37
 
      </varlistentry>
38
 
      <varlistentry>
39
 
        <term>_iVar</term>
40
 
        <listitem>
41
 
          <para>
42
 
            Position in the Scilab memory where you want to put the variable.
43
 
          </para>
44
 
        </listitem>
45
 
      </varlistentry>
46
 
      <varlistentry>
47
 
        <term>_pstName</term>
48
 
        <listitem>
49
 
          <para>
50
 
            Name of the variable for "named" functions.
51
 
          </para>
52
 
        </listitem>
53
 
      </varlistentry>
54
 
      <varlistentry>
55
 
        <term>_iRows</term>
56
 
        <listitem>
57
 
          <para>
58
 
            Number of rows of the new variable.
59
 
          </para>
60
 
        </listitem>
61
 
      </varlistentry>
62
 
      <varlistentry>
63
 
        <term>_iCols</term>
64
 
        <listitem>
65
 
          <para>
66
 
            Number of columns of the new variable.
67
 
          </para>
68
 
        </listitem>
69
 
      </varlistentry>
70
 
      <varlistentry>
71
 
        <term>_iNbItem</term>
72
 
        <listitem>
73
 
          <para>
74
 
            Number of non zero itmes in the sparse.
75
 
          </para>
76
 
        </listitem>
77
 
      </varlistentry>
78
 
      <varlistentry>
79
 
        <term>_piNbItemRow</term>
80
 
        <listitem>
81
 
          <para>
82
 
            Number of item in each rows (size: _iRows).
83
 
          </para>
84
 
        </listitem>
85
 
      </varlistentry>
86
 
      <varlistentry>
87
 
        <term>_piColPos</term>
88
 
        <listitem>
89
 
          <para>
90
 
            Column position for each item (size: _iNbItem).
91
 
          </para>
92
 
        </listitem>
93
 
      </varlistentry>
94
 
      <varlistentry>
95
 
        <term>SciErr</term>
96
 
        <listitem>
97
 
          <para>
98
 
            Error structure where is stored errors messages history and first error number.
99
 
          </para>
100
 
        </listitem>
101
 
      </varlistentry>
102
 
    </variablelist>
103
 
  </refsection>
104
 
  <refsynopsisdiv>
105
 
    <refsection>
106
 
      Write directly in Scilab memory.
107
 
    </refsection>
108
 
    <title>Calling Sequence</title>
109
 
    <para>Input argument profile:</para>
110
 
    <synopsis>SciErr allocBooleanSparseMatrix(void* _pvCtx, int _iVar, int _iRows, int _iCols, int _iNbItem, int** _piNbItemRow, int** _piColPos)</synopsis>
111
 
  </refsynopsisdiv>
112
 
  <refsection>
113
 
    <title>Arguments</title>
114
 
    <variablelist>
115
 
      <varlistentry>
116
 
        <term>_pvCtx</term>
117
 
        <listitem>
118
 
          <para>
119
 
            Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h.
120
 
          </para>
121
 
        </listitem>
122
 
      </varlistentry>
123
 
      <varlistentry>
124
 
        <term>_iVar</term>
125
 
        <listitem>
126
 
          <para>
127
 
            Position in the Scilab memory where you want to put the variable.
128
 
          </para>
129
 
        </listitem>
130
 
      </varlistentry>
131
 
      <varlistentry>
132
 
        <term>_iRows</term>
133
 
        <listitem>
134
 
          <para>
135
 
            Number of rows of the new variable.
136
 
          </para>
137
 
        </listitem>
138
 
      </varlistentry>
139
 
      <varlistentry>
140
 
        <term>_iCols</term>
141
 
        <listitem>
142
 
          <para>
143
 
            Number of columns of the new variable.
144
 
          </para>
145
 
        </listitem>
146
 
      </varlistentry>
147
 
      <varlistentry>
148
 
        <term>_iNbItem</term>
149
 
        <listitem>
150
 
          <para>
151
 
            Number of non zero itmes in the sparse.
152
 
          </para>
153
 
        </listitem>
154
 
      </varlistentry>
155
 
      <varlistentry>
156
 
        <term>_piNbItemRow</term>
157
 
        <listitem>
158
 
          <para>
159
 
            Number of item in each rows (size: _iRows).
160
 
          </para>
161
 
        </listitem>
162
 
      </varlistentry>
163
 
      <varlistentry>
164
 
        <term>_piColPos</term>
165
 
        <listitem>
166
 
          <para>
167
 
            Column position for each item (size: _iNbItem).
168
 
          </para>
169
 
        </listitem>
170
 
      </varlistentry>
171
 
      <varlistentry>
172
 
        <term>SciErr</term>
173
 
        <listitem>
174
 
          <para>
175
 
            Error structure where is stored errors messages history and first error number.
176
 
          </para>
177
 
        </listitem>
178
 
      </varlistentry>
179
 
    </variablelist>
180
 
  </refsection>
181
 
  <refsection>
182
 
    <title>Description</title>
183
 
    <para>This help describes how to add boolean sparse matrix in a list.</para>
184
 
  </refsection>
185
 
  <refsection>
186
 
    <!--File_gateway: SCI/modules/api_scilab/tests/unit_tests/read_write_bsparse_api.c-->
187
 
    <!--File_scilab: SCI/modules/api_scilab/tests/unit_tests/read_write_bsparse_api.tst-->
188
 
    <!--Lib_name: read_write_bsparse-->
189
 
    <!--Func_list: read_write_bsparse-->
190
 
    <title>Gateway Source</title>
191
 
    <programlisting role="code_gateway"><![CDATA[ 
 
14
    <refnamediv>
 
15
        <refname>Boolean sparse writing (Scilab gateway)</refname>
 
16
        <refpurpose>
 
17
            How to add boolean sparse matrix in a gateway.
 
18
        </refpurpose>
 
19
    </refnamediv>
 
20
    <refsynopsisdiv>
 
21
        <title>Calling Sequence</title>
 
22
        <para>Input argument profile:</para>
 
23
        <synopsis>SciErr createBooleanSparseMatrix(void* _pvCtx, int _iVar, int _iRows, int _iCols, int _iNbItem, const int* _piNbItemRow, const int* _piColPos)</synopsis>
 
24
        <para>Named variable profile:</para>
 
25
        <synopsis>SciErr createNamedBooleanSparseMatrix(void* _pvCtx, const char* _pstName, int _iRows, int _iCols, int _iNbItem, const int* _piNbItemRow, const int* _piColPos)</synopsis>
 
26
    </refsynopsisdiv>
 
27
    <refsection>
 
28
        <title>Arguments</title>
 
29
        <variablelist>
 
30
            <varlistentry>
 
31
                <term>_pvCtx</term>
 
32
                <listitem>
 
33
                    <para>
 
34
                        Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h.
 
35
                    </para>
 
36
                </listitem>
 
37
            </varlistentry>
 
38
            <varlistentry>
 
39
                <term>_iVar</term>
 
40
                <listitem>
 
41
                    <para>
 
42
                        Position in the Scilab memory where you want to put the variable.
 
43
                    </para>
 
44
                </listitem>
 
45
            </varlistentry>
 
46
            <varlistentry>
 
47
                <term>_pstName</term>
 
48
                <listitem>
 
49
                    <para>
 
50
                        Name of the variable for "named" functions.
 
51
                    </para>
 
52
                </listitem>
 
53
            </varlistentry>
 
54
            <varlistentry>
 
55
                <term>_iRows</term>
 
56
                <listitem>
 
57
                    <para>
 
58
                        Number of rows of the new variable.
 
59
                    </para>
 
60
                </listitem>
 
61
            </varlistentry>
 
62
            <varlistentry>
 
63
                <term>_iCols</term>
 
64
                <listitem>
 
65
                    <para>
 
66
                        Number of columns of the new variable.
 
67
                    </para>
 
68
                </listitem>
 
69
            </varlistentry>
 
70
            <varlistentry>
 
71
                <term>_iNbItem</term>
 
72
                <listitem>
 
73
                    <para>
 
74
                        Number of non zero itmes in the sparse.
 
75
                    </para>
 
76
                </listitem>
 
77
            </varlistentry>
 
78
            <varlistentry>
 
79
                <term>_piNbItemRow</term>
 
80
                <listitem>
 
81
                    <para>
 
82
                        Number of item in each rows (size: _iRows).
 
83
                    </para>
 
84
                </listitem>
 
85
            </varlistentry>
 
86
            <varlistentry>
 
87
                <term>_piColPos</term>
 
88
                <listitem>
 
89
                    <para>
 
90
                        Column position for each item (size: _iNbItem).
 
91
                    </para>
 
92
                </listitem>
 
93
            </varlistentry>
 
94
            <varlistentry>
 
95
                <term>SciErr</term>
 
96
                <listitem>
 
97
                    <para>
 
98
                        Error structure where is stored errors messages history and first error number.
 
99
                    </para>
 
100
                </listitem>
 
101
            </varlistentry>
 
102
        </variablelist>
 
103
    </refsection>
 
104
    <refsynopsisdiv>
 
105
        <refsection>
 
106
            Write directly in Scilab memory.
 
107
        </refsection>
 
108
        <title>Calling Sequence</title>
 
109
        <para>Input argument profile:</para>
 
110
        <synopsis>SciErr allocBooleanSparseMatrix(void* _pvCtx, int _iVar, int _iRows, int _iCols, int _iNbItem, int** _piNbItemRow, int** _piColPos)</synopsis>
 
111
    </refsynopsisdiv>
 
112
    <refsection>
 
113
        <title>Arguments</title>
 
114
        <variablelist>
 
115
            <varlistentry>
 
116
                <term>_pvCtx</term>
 
117
                <listitem>
 
118
                    <para>
 
119
                        Scilab environment pointer, pass in "pvApiCtx" provided by api_scilab.h.
 
120
                    </para>
 
121
                </listitem>
 
122
            </varlistentry>
 
123
            <varlistentry>
 
124
                <term>_iVar</term>
 
125
                <listitem>
 
126
                    <para>
 
127
                        Position in the Scilab memory where you want to put the variable.
 
128
                    </para>
 
129
                </listitem>
 
130
            </varlistentry>
 
131
            <varlistentry>
 
132
                <term>_iRows</term>
 
133
                <listitem>
 
134
                    <para>
 
135
                        Number of rows of the new variable.
 
136
                    </para>
 
137
                </listitem>
 
138
            </varlistentry>
 
139
            <varlistentry>
 
140
                <term>_iCols</term>
 
141
                <listitem>
 
142
                    <para>
 
143
                        Number of columns of the new variable.
 
144
                    </para>
 
145
                </listitem>
 
146
            </varlistentry>
 
147
            <varlistentry>
 
148
                <term>_iNbItem</term>
 
149
                <listitem>
 
150
                    <para>
 
151
                        Number of non zero itmes in the sparse.
 
152
                    </para>
 
153
                </listitem>
 
154
            </varlistentry>
 
155
            <varlistentry>
 
156
                <term>_piNbItemRow</term>
 
157
                <listitem>
 
158
                    <para>
 
159
                        Number of item in each rows (size: _iRows).
 
160
                    </para>
 
161
                </listitem>
 
162
            </varlistentry>
 
163
            <varlistentry>
 
164
                <term>_piColPos</term>
 
165
                <listitem>
 
166
                    <para>
 
167
                        Column position for each item (size: _iNbItem).
 
168
                    </para>
 
169
                </listitem>
 
170
            </varlistentry>
 
171
            <varlistentry>
 
172
                <term>SciErr</term>
 
173
                <listitem>
 
174
                    <para>
 
175
                        Error structure where is stored errors messages history and first error number.
 
176
                    </para>
 
177
                </listitem>
 
178
            </varlistentry>
 
179
        </variablelist>
 
180
    </refsection>
 
181
    <refsection>
 
182
        <title>Description</title>
 
183
        <para>This help describes how to add boolean sparse matrix in a list.</para>
 
184
    </refsection>
 
185
    <refsection>
 
186
        <!--File_gateway: SCI/modules/api_scilab/tests/unit_tests/read_write_bsparse_api.c-->
 
187
        <!--File_scilab: SCI/modules/api_scilab/tests/unit_tests/read_write_bsparse_api.tst-->
 
188
        <!--Lib_name: read_write_bsparse-->
 
189
        <!--Func_list: read_write_bsparse-->
 
190
        <title>Gateway Source</title>
 
191
        <programlisting role="code_gateway"><![CDATA[ 
192
192
#include "api_scilab.h"
193
193
int read_write_bsparse(char *fname,unsigned long fname_len)
194
194
{
259
259
        iCol += piNbItemRow[i];
260
260
    }
261
261
 
262
 
    sciErr = createBooleanSparseMatrix(pvApiCtx, nbInputArgument + 1, iRows, iCols, iNewItem, piNewRow, piNewCol);
 
262
    sciErr = createBooleanSparseMatrix(pvApiCtx, nbInputArgument(pvApiCtx) + 1, iRows, iCols, iNewItem, piNewRow, piNewCol);
263
263
    if(sciErr.iErr)
264
264
    {
265
265
        printError(&sciErr, 0);
266
266
        return 0;
267
267
    }
268
268
 
269
 
    AssignOutputVariable(1) = nbInputArgument + 1;
 
269
    AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
270
270
    return 0;
271
271
}
272
272
 ]]></programlisting>
273
 
  </refsection>
274
 
  <refsection>
275
 
    <title>Scilab test script</title>
276
 
    <programlisting role="code_scilab"><![CDATA[ 
 
273
    </refsection>
 
274
    <refsection>
 
275
        <title>Scilab test script</title>
 
276
        <programlisting role="code_scilab"><![CDATA[ 
277
277
a = sparse([%t, %f, %t ; %f, %t, %f ; %t, %f, %t]);
278
278
a_ref = sparse([%f, %t, %f ; %t, %f, %t ; %f, %t, %f]);
279
279
 
280
280
b = read_write_bsparse(a);
281
281
if or(b <> a_ref) then error("failed");end
282
282
 ]]></programlisting>
283
 
  </refsection>
 
283
    </refsection>
284
284
</refentry>