File: Functions-of-a-Matrix.html

package info (click to toggle)
octave 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 124,192 kB
  • sloc: cpp: 322,665; ansic: 68,088; fortran: 20,980; objc: 8,121; sh: 7,719; yacc: 4,266; lex: 4,123; perl: 1,530; java: 1,366; awk: 1,257; makefile: 424; xml: 147
file content (198 lines) | stat: -rw-r--r-- 7,941 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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Functions of a Matrix (GNU Octave (version 6.2.0))</title>

<meta name="description" content="Functions of a Matrix (GNU Octave (version 6.2.0))">
<meta name="keywords" content="Functions of a Matrix (GNU Octave (version 6.2.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Linear-Algebra.html" rel="up" title="Linear Algebra">
<link href="Specialized-Solvers.html" rel="next" title="Specialized Solvers">
<link href="Matrix-Factorizations.html" rel="prev" title="Matrix Factorizations">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<span id="Functions-of-a-Matrix"></span><div class="header">
<p>
Next: <a href="Specialized-Solvers.html" accesskey="n" rel="next">Specialized Solvers</a>, Previous: <a href="Matrix-Factorizations.html" accesskey="p" rel="prev">Matrix Factorizations</a>, Up: <a href="Linear-Algebra.html" accesskey="u" rel="up">Linear Algebra</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="Functions-of-a-Matrix-1"></span><h3 class="section">18.4 Functions of a Matrix</h3>
<span id="index-matrix_002c-functions-of"></span>

<span id="XREFexpm"></span><dl>
<dt id="index-expm">: <em></em> <strong>expm</strong> <em>(<var>A</var>)</em></dt>
<dd><p>Return the exponential of a matrix.
</p>
<p>The matrix exponential is defined as the infinite Taylor series
</p>
<div class="example">
<pre class="example">expm (A) = I + A + A^2/2! + A^3/3! + &hellip;
</pre></div>

<p>However, the Taylor series is <em>not</em> the way to compute the matrix
exponential; see Moler and Van Loan, <cite>Nineteen Dubious Ways
to Compute the Exponential of a Matrix</cite>, SIAM Review, 1978.  This routine
uses Ward&rsquo;s diagonal Pad&eacute; approximation method with three step
preconditioning (SIAM Journal on Numerical Analysis, 1977).  Diagonal
Pad&eacute; approximations are rational polynomials of matrices
</p>
<div class="example">
<pre class="example">     -1
D (A)   N (A)
</pre></div>

<p>whose Taylor series matches the first
<code>2q+1</code>
terms of the Taylor series above; direct evaluation of the Taylor series
(with the same preconditioning steps) may be desirable in lieu of the
Pad&eacute; approximation when
<code>Dq(A)</code>
is ill-conditioned.
</p>
<p><strong>See also:</strong> <a href="#XREFlogm">logm</a>, <a href="#XREFsqrtm">sqrtm</a>.
</p></dd></dl>


<span id="XREFlogm"></span><dl>
<dt id="index-logm">: <em><var>s</var> =</em> <strong>logm</strong> <em>(<var>A</var>)</em></dt>
<dt id="index-logm-1">: <em><var>s</var> =</em> <strong>logm</strong> <em>(<var>A</var>, <var>opt_iters</var>)</em></dt>
<dt id="index-logm-2">: <em>[<var>s</var>, <var>iters</var>] =</em> <strong>logm</strong> <em>(&hellip;)</em></dt>
<dd><p>Compute the matrix logarithm of the square matrix <var>A</var>.
</p>
<p>The implementation utilizes a Pad&eacute; approximant and the identity
</p>
<div class="example">
<pre class="example">logm (<var>A</var>) = 2^k * logm (<var>A</var>^(1 / 2^k))
</pre></div>

<p>The optional input <var>opt_iters</var> is the maximum number of square roots
to compute and defaults to 100.
</p>
<p>The optional output <var>iters</var> is the number of square roots actually
computed.
</p>
<p><strong>See also:</strong> <a href="#XREFexpm">expm</a>, <a href="#XREFsqrtm">sqrtm</a>.
</p></dd></dl>


<span id="XREFsqrtm"></span><dl>
<dt id="index-sqrtm">: <em><var>s</var> =</em> <strong>sqrtm</strong> <em>(<var>A</var>)</em></dt>
<dt id="index-sqrtm-1">: <em>[<var>s</var>, <var>error_estimate</var>] =</em> <strong>sqrtm</strong> <em>(<var>A</var>)</em></dt>
<dd><p>Compute the matrix square root of the square matrix <var>A</var>.
</p>
<p>Ref: N.J. Higham.  <cite>A New sqrtm for <small>MATLAB</small></cite>.  Numerical
Analysis Report No. 336, Manchester Centre for Computational
Mathematics, Manchester, England, January 1999.
</p>
<p><strong>See also:</strong> <a href="#XREFexpm">expm</a>, <a href="#XREFlogm">logm</a>.
</p></dd></dl>


<span id="XREFkron"></span><dl>
<dt id="index-kron">: <em></em> <strong>kron</strong> <em>(<var>A</var>, <var>B</var>)</em></dt>
<dt id="index-kron-1">: <em></em> <strong>kron</strong> <em>(<var>A1</var>, <var>A2</var>, &hellip;)</em></dt>
<dd><p>Form the Kronecker product of two or more matrices.
</p>
<p>This is defined block by block as
</p>
<div class="example">
<pre class="example">x = [ a(i,j)*b ]
</pre></div>

<p>For example:
</p>
<div class="example">
<pre class="example">kron (1:4, ones (3, 1))
     &rArr;  1  2  3  4
         1  2  3  4
         1  2  3  4
</pre></div>

<p>If there are more than two input arguments <var>A1</var>, <var>A2</var>, &hellip;,
<var>An</var> the Kronecker product is computed as
</p>
<div class="example">
<pre class="example">kron (kron (<var>A1</var>, <var>A2</var>), &hellip;, <var>An</var>)
</pre></div>

<p>Since the Kronecker product is associative, this is well-defined.
</p></dd></dl>


<span id="XREFblkmm"></span><dl>
<dt id="index-blkmm">: <em></em> <strong>blkmm</strong> <em>(<var>A</var>, <var>B</var>)</em></dt>
<dd><p>Compute products of matrix blocks.
</p>
<p>The blocks are given as 2-dimensional subarrays of the arrays <var>A</var>,
<var>B</var>.  The size of <var>A</var> must have the form <code>[m,k,&hellip;]</code> and
size of <var>B</var> must be <code>[k,n,&hellip;]</code>.  The result is then of size
<code>[m,n,&hellip;]</code> and is computed as follows:
</p>
<div class="example">
<pre class="example">for i = 1:prod (size (<var>A</var>)(3:end))
  <var>C</var>(:,:,i) = <var>A</var>(:,:,i) * <var>B</var>(:,:,i)
endfor
</pre></div>
</dd></dl>


<span id="XREFsylvester"></span><dl>
<dt id="index-sylvester">: <em><var>X</var> =</em> <strong>sylvester</strong> <em>(<var>A</var>, <var>B</var>, <var>C</var>)</em></dt>
<dd><p>Solve the Sylvester equation.
</p>
<p>The Sylvester equation is defined as:
</p>
<div class="example">
<pre class="example">A X + X B = C
</pre></div>

<p>The solution is computed using standard <small>LAPACK</small> subroutines.
</p>
<p>For example:
</p>
<div class="example">
<pre class="example">sylvester ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12])
   &rArr; [ 0.50000, 0.66667; 0.66667, 0.50000 ]
</pre></div>
</dd></dl>


<hr>
<div class="header">
<p>
Next: <a href="Specialized-Solvers.html" accesskey="n" rel="next">Specialized Solvers</a>, Previous: <a href="Matrix-Factorizations.html" accesskey="p" rel="prev">Matrix Factorizations</a>, Up: <a href="Linear-Algebra.html" accesskey="u" rel="up">Linear Algebra</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>