~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/eng/programming/mlist.xml

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
 
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
 
3
<MAN>
 
4
  <LANGUAGE>eng</LANGUAGE>
 
5
  <TITLE>mlist</TITLE>
 
6
  <TYPE>Scilab Function</TYPE>
 
7
  <DATE>September 1995</DATE>
 
8
  <SHORT_DESCRIPTION name="mlist"> Scilab object, matrix oriented typed list definition.  </SHORT_DESCRIPTION>
 
9
  <CALLING_SEQUENCE>
 
10
    <CALLING_SEQUENCE_ITEM>mlist(typ,a1,....an )    </CALLING_SEQUENCE_ITEM>
 
11
  </CALLING_SEQUENCE>
 
12
  <PARAM>
 
13
    <PARAM_INDENT>
 
14
      <PARAM_ITEM>
 
15
        <PARAM_NAME>typ</PARAM_NAME>
 
16
        <PARAM_DESCRIPTION>
 
17
          <SP>: vector of character strings</SP>
 
18
        </PARAM_DESCRIPTION>
 
19
      </PARAM_ITEM>
 
20
      <PARAM_ITEM>
 
21
        <PARAM_NAME>ai</PARAM_NAME>
 
22
        <PARAM_DESCRIPTION>
 
23
          <SP>: any Scilab object (<VERB>matrix, list,string...</VERB>).</SP>
 
24
        </PARAM_DESCRIPTION>
 
25
      </PARAM_ITEM>
 
26
    </PARAM_INDENT>
 
27
  </PARAM>
 
28
  <DESCRIPTION>
 
29
    <P>
 
30
    mlist object are very similar to tlist objects. But if <VERB>M</VERB> is an
 
31
    mlist, for any index <VERB>i</VERB> which is not a field name, <VERB>M(i)</VERB> is
 
32
    not the <VERB>i</VERB>th field of the list but is interpreted as the <VERB>i</VERB>
 
33
    th entry of <VERB>M</VERB> seen as a vector. This is the only difference
 
34
    between  <VERB>mlist</VERB> and  <VERB>tlist</VERB>.</P>
 
35
    <P>
 
36
    mlist fields must then be designed by their names. They can also be
 
37
    handled using the <VERB>getfield</VERB>  and <VERB>setfield</VERB>  functions.</P>
 
38
  </DESCRIPTION>
 
39
  <EXAMPLE>
 
40
<![CDATA[
 
41
M=mlist(['V','name','value'],['a','b','c'],[1 2 3]);
 
42
//define display
 
43
deff('%V_p(M)','disp(M.name+'':''+string(M.value))')
 
44
//define extraction operation
 
45
deff('r=%V_e(i,M)',..
 
46
'r=mlist([''V'',''name'',''value''],M.name(i),M.value(i))')
 
47
M(2) // the second entry of the vector M
 
48
M(2).value 
 
49
 
 
50
//define M as a tlist
 
51
M=tlist(['V','name','value'],['a','b','c'],[1 2 3]);
 
52
M(2)
 
53
 
 
54
M('name')
 
55
 
 
56
//with two  indices
 
57
M=mlist(['V','name','value'],['a','b';'c' 'd'],[1 2;3 4]);
 
58
deff('r=%V_e(varargin)',[
 
59
    'M=varargin($)';
 
60
    'H=[''V'',''name'',''value'']'
 
61
    'r=mlist(H,M.name(varargin(1:$-1)),M.value(varargin(1:$-1)))'])
 
62
 
 
63
M(:,2)
 
64
// multidimensionnal array
 
65
str=['a','b','c','d','e','f','g','h'];
 
66
n=hypermat([2,2,2],str);
 
67
v=hypermat([2,2,2],1:8);
 
68
M=mlist(['V','name','value'],n,v);
 
69
M(1,1:2,2)
 
70
 ]]>
 
71
  </EXAMPLE>
 
72
  <SEE_ALSO>
 
73
    <SEE_ALSO_ITEM>
 
74
      <LINK>tlist</LINK>
 
75
    </SEE_ALSO_ITEM>
 
76
    <SEE_ALSO_ITEM>
 
77
      <LINK>list</LINK>
 
78
    </SEE_ALSO_ITEM>
 
79
    <SEE_ALSO_ITEM>
 
80
      <LINK>overloading</LINK>
 
81
    </SEE_ALSO_ITEM>
 
82
    <SEE_ALSO_ITEM>
 
83
      <LINK>getfield</LINK>
 
84
    </SEE_ALSO_ITEM>
 
85
    <SEE_ALSO_ITEM>
 
86
      <LINK>setfield</LINK>
 
87
    </SEE_ALSO_ITEM>
 
88
  </SEE_ALSO>
 
89
</MAN>