File: Mat.html

package info (click to toggle)
torch 2-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,488 kB
  • ctags: 3,217
  • sloc: cpp: 14,272; makefile: 201
file content (218 lines) | stat: -rw-r--r-- 9,642 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD>
   <TITLE>class  Mat</TITLE>
   <META NAME="GENERATOR" CONTENT="DOC++ 3.4.8">
</HEAD>
<BODY BGCOLOR="#ffffff">

<H2>class  <A HREF="#DOC.DOCU">Mat</A></H2></H2><BLOCKQUOTE>Matrix object.</BLOCKQUOTE>
<HR>

<H2>Inheritance:</H2>
<APPLET CODE="ClassGraph.class" WIDTH=600 HEIGHT=65>
<param name=classes value="CObject,MObject.html,CMat,MMat.html">
<param name=before value="M,M">
<param name=after value="Md_,M">
<param name=indent value="0,1">
<param name=arrowdir value="down">
</APPLET>
<HR>

<DL>
<P><DL>
<DT><H3>Public Fields</H3><DD><DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>bool <B><A HREF="#DOC.77.1">ptr_is_allocated</A></B>
<DD><I><TT>false</TT> if <TT>ptr</TT> is not allocated by Mat.</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>int <B><A HREF="#DOC.77.2">m</A></B>
<DD><I>Size of the matrix</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>real** <B><A HREF="#DOC.77.3">ptr</A></B>
<DD><I>Data of the matrix</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>real* <B><A HREF="#DOC.77.4">base</A></B>
<DD><I>NULL if not allocated by Mat.</I>
</DL></P>

<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.77.5">Mat</A></B>(real**  ptr_, int n_rows, int <!1><A HREF="IOHtk.html#DOC.122.2">n_cols</A>)
<DD><I>Create a matrix from values in <TT>ptr_</TT>.</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif> <B><A HREF="#DOC.77.6">Mat</A></B>(int n_rows, int <!1><A HREF="IOHtk.html#DOC.122.2">n_cols</A>)
<DD><I>Create a new matrix</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.77.7">copy</A></B>(<!1><A HREF="Mat.html">Mat</A>*  mat)
<DD><I>Copy the matrix <TT>mat</TT></I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.77.8">zero</A></B>()
<DD><I>Zero the matrix</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>real <B><A HREF="#DOC.77.9">norm1</A></B>()
<DD><I>Compute the norm1</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>real <B><A HREF="#DOC.77.10">normFrobenius</A></B>()
<DD><I>Compute the Frobenius norm</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>real <B><A HREF="#DOC.77.11">normInf</A></B>()
<DD><I>Compute the norm inf</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif><!1><A HREF="Vec.html">Vec</A>* <B><A HREF="#DOC.77.12">getRow</A></B>(int row, <!1><A HREF="Vec.html">Vec</A>*  vec = NULL)
<DD><I>Return the row <TT>row</TT> of the matrix.</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif><!1><A HREF="Vec.html">Vec</A>* <B><A HREF="#DOC.77.13">getCol</A></B>(int col, <!1><A HREF="Vec.html">Vec</A>*  vec = NULL)
<DD><I>Return the column <TT>col</TT> of the matrix.</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.77.14">setRow</A></B>(int row, <!1><A HREF="Vec.html">Vec</A>*  vec)
<DD><I>Set the row <TT>row</TT> to values in <TT>vec</TT></I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>void <B><A HREF="#DOC.77.15">setCol</A></B>(int row, <!1><A HREF="Vec.html">Vec</A>*  vec)
<DD><I>Set the column <TT>col</TT> to values in <TT>vec</TT></I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif><!1><A HREF="Mat.html">Mat</A>* <B><A HREF="#DOC.77.16">subMat</A></B>(int row1, int col1, int row2, int col2)
<DD><I>Return a sub-matrix.</I>
</DL></P>

</DL>
<HR><H3>Inherited from <A HREF="Object.html">Object</A>:</H3>
<DL>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="o" SRC=icon2.gif>virtual   void <B>init</B>()
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>addOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, int size, void* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>, const char* <!1><A HREF="CmdLine.html#DOC.7.3">help</A>="", bool is_allowed_after_init=false)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>addIOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, int* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>, int init_value, const char* <!1><A HREF="CmdLine.html#DOC.7.3">help</A>="", bool is_allowed_after_init=false)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>addROption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, real* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>, real init_value, const char* <!1><A HREF="CmdLine.html#DOC.7.3">help</A>="", bool is_allowed_after_init=false)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>addBOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, bool* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>, bool init_value, const char* <!1><A HREF="CmdLine.html#DOC.7.3">help</A>="", bool is_allowed_after_init=false)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>setOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, void* <!1><A HREF="Vec.html#DOC.81.3">ptr</A>)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>setIOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, int option)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>setROption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, real option)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>setBOption</B>(const char* <!1><A HREF="SeqExample.html#DOC.107.9">name</A>, bool option)
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual   void <B>loadFILE</B>(FILE* <!1><A HREF="Measurer.html#DOC.30.2">file</A>)
<DT>
<IMG ALT="o" SRC=icon2.gif>virtual   void <B>saveFILE</B>(FILE* <!1><A HREF="Measurer.html#DOC.30.2">file</A>)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>load</B>(const char* filename)
<DT>
<IMG ALT="o" SRC=icon2.gif>void <B>save</B>(const char* filename)
</DL></P>

</DL>

<A NAME="DOC.DOCU"></A>
<HR>
<H2>Documentation</H2>
<BLOCKQUOTE>Matrix object.

<P></BLOCKQUOTE>
<DL>

<A NAME="ptr_is_allocated"></A>
<A NAME="DOC.77.1"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool ptr_is_allocated</B></TT>
<DD><TT>false</TT> if <TT>ptr</TT> is not allocated by Mat.
(With the first constructor)
<DL><DT><DD></DL><P>
<A NAME="m"></A>
<A NAME="DOC.77.2"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int m</B></TT>
<DD>Size of the matrix
<DL><DT><DD></DL><P>
<A NAME="ptr"></A>
<A NAME="DOC.77.3"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>real** ptr</B></TT>
<DD>Data of the matrix
<DL><DT><DD></DL><P>
<A NAME="base"></A>
<A NAME="DOC.77.4"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>real* base</B></TT>
<DD>NULL if not allocated by Mat.
(when you're using the first constructor of Mat, or for
the matrix returned by subMat)
<DL><DT><DD></DL><P>
<A NAME="Mat"></A>
<A NAME="DOC.77.5"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Mat(real**  ptr_, int n_rows, int <!1><A HREF="IOHtk.html#DOC.122.2">n_cols</A>)</B></TT>
<DD>Create a matrix from values in <TT>ptr_</TT>.
(No memory copy).
<DL><DT><DD></DL><P>
<A NAME="Mat"></A>
<A NAME="DOC.77.6"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Mat(int n_rows, int <!1><A HREF="IOHtk.html#DOC.122.2">n_cols</A>)</B></TT>
<DD>Create a new matrix
<DL><DT><DD></DL><P>
<A NAME="copy"></A>
<A NAME="DOC.77.7"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void copy(<!1><A HREF="Mat.html">Mat</A>*  mat)</B></TT>
<DD>Copy the matrix <TT>mat</TT>
<DL><DT><DD></DL><P>
<A NAME="zero"></A>
<A NAME="DOC.77.8"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void zero()</B></TT>
<DD>Zero the matrix
<DL><DT><DD></DL><P>
<A NAME="norm1"></A>
<A NAME="DOC.77.9"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>real norm1()</B></TT>
<DD>Compute the norm1
<DL><DT><DD></DL><P>
<A NAME="normFrobenius"></A>
<A NAME="DOC.77.10"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>real normFrobenius()</B></TT>
<DD>Compute the Frobenius norm
<DL><DT><DD></DL><P>
<A NAME="normInf"></A>
<A NAME="DOC.77.11"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>real normInf()</B></TT>
<DD>Compute the norm inf
<DL><DT><DD></DL><P>
<A NAME="getRow"></A>
<A NAME="DOC.77.12"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="Vec.html">Vec</A>* getRow(int row, <!1><A HREF="Vec.html">Vec</A>*  vec = NULL)</B></TT>
<DD>Return the row <TT>row</TT> of the matrix.
If <TT>vec</TT> is NULL, return a new vector.
Else copy the row in <TT>vec</TT>.
<DL><DT><DD></DL><P>
<A NAME="getCol"></A>
<A NAME="DOC.77.13"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="Vec.html">Vec</A>* getCol(int col, <!1><A HREF="Vec.html">Vec</A>*  vec = NULL)</B></TT>
<DD>Return the column <TT>col</TT> of the matrix.
If <TT>vec</TT> is NULL, return a new vector.
Else copy the column in <TT>vec</TT>.
<DL><DT><DD></DL><P>
<A NAME="setRow"></A>
<A NAME="DOC.77.14"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void setRow(int row, <!1><A HREF="Vec.html">Vec</A>*  vec)</B></TT>
<DD>Set the row <TT>row</TT> to values in <TT>vec</TT>
<DL><DT><DD></DL><P>
<A NAME="setCol"></A>
<A NAME="DOC.77.15"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void setCol(int row, <!1><A HREF="Vec.html">Vec</A>*  vec)</B></TT>
<DD>Set the column <TT>col</TT> to values in <TT>vec</TT>
<DL><DT><DD></DL><P>
<A NAME="subMat"></A>
<A NAME="DOC.77.16"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="Mat.html">Mat</A>* subMat(int row1, int col1, int row2, int col2)</B></TT>
<DD>Return a sub-matrix.
Note that the memory is shared with the original
matrix, so *be carefull*.
<DL><DT><DD></DL><P></DL>

<HR><DL><DT><B>This class has no child classes.</B></DL>

<DL><DT><DT><B>Author:</B><DD>Ronan Collobert (collober@iro.umontreal.ca)
<DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I></P><HR>
<BR>
This page was generated with the help of <A HREF="http://docpp.sourceforge.net">DOC++</A>.
</BODY>
</HTML>