annotate scripts/linear-algebra/expm.m @ 9065:8207b833557f

Cleanup documentation for arith.texi, linalg.texi, nonlin.texi Grammarcheck input .txi files Spellcheck .texi files
author Rik <rdrider0-list@yahoo.com>
date Sat, 28 Mar 2009 17:43:22 -0700
parents 867d5d1aed06
children f0c3d3fc4903
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8757
diff changeset
1 ## Copyright (C) 2008, 2009 Jaroslav Hajek, Marco Caliari
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
2 ##
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
3 ## This file is part of Octave.
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
4 ##
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
8 ## your option) any later version.
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
9 ##
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
13 ## General Public License for more details.
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
14 ##
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
18
9065
8207b833557f Cleanup documentation for arith.texi, linalg.texi, nonlin.texi
Rik <rdrider0-list@yahoo.com>
parents: 9048
diff changeset
19 ## -*- texinfo -*-
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
20 ## @deftypefn {Function File} {} expm (@var{a})
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
21 ## Return the exponential of a matrix, defined as the infinite Taylor
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
22 ## series
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
23 ## @iftex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
24 ## @tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
25 ## $$
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
26 ## \exp (A) = I + A + {A^2 \over 2!} + {A^3 \over 3!} + \cdots
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
27 ## $$
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
28 ## @end tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
29 ## @end iftex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
30 ## @ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
31 ##
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
32 ## @example
9065
8207b833557f Cleanup documentation for arith.texi, linalg.texi, nonlin.texi
Rik <rdrider0-list@yahoo.com>
parents: 9048
diff changeset
33 ## expm(a) = I + a + a^2/2! + a^3/3! + @dots{}
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
34 ## @end example
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
35 ##
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
36 ## @end ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
37 ## The Taylor series is @emph{not} the way to compute the matrix
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
38 ## exponential; see Moler and Van Loan, @cite{Nineteen Dubious Ways to
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
39 ## Compute the Exponential of a Matrix}, SIAM Review, 1978. This routine
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
40 ## uses Ward's diagonal
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
41 ## @iftex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
42 ## @tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
43 ## Pad\'e
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
44 ## @end tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
45 ## @end iftex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
46 ## @ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
47 ## Pade'
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
48 ## @end ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
49 ## approximation method with three step preconditioning (SIAM Journal on
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
50 ## Numerical Analysis, 1977). Diagonal
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
51 ## @iftex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
52 ## @tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
53 ## Pad\'e
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
54 ## @end tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
55 ## @end iftex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
56 ## @ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
57 ## Pade'
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
58 ## @end ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
59 ## approximations are rational polynomials of matrices
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
60 ## @iftex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
61 ## @tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
62 ## $D_q(a)^{-1}N_q(a)$
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
63 ## @end tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
64 ## @end iftex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
65 ## @ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
66 ##
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
67 ## @example
9065
8207b833557f Cleanup documentation for arith.texi, linalg.texi, nonlin.texi
Rik <rdrider0-list@yahoo.com>
parents: 9048
diff changeset
68 ## @group
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
69 ## -1
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
70 ## D (a) N (a)
9065
8207b833557f Cleanup documentation for arith.texi, linalg.texi, nonlin.texi
Rik <rdrider0-list@yahoo.com>
parents: 9048
diff changeset
71 ## @end group
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
72 ## @end example
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
73 ##
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
74 ## @end ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
75 ## whose Taylor series matches the first
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
76 ## @iftex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
77 ## @tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
78 ## $2 q + 1 $
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
79 ## @end tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
80 ## @end iftex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
81 ## @ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
82 ## @code{2q+1}
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
83 ## @end ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
84 ## terms of the Taylor series above; direct evaluation of the Taylor series
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
85 ## (with the same preconditioning steps) may be desirable in lieu of the
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
86 ## @iftex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
87 ## @tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
88 ## Pad\'e
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
89 ## @end tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
90 ## @end iftex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
91 ## @ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
92 ## Pade'
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
93 ## @end ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
94 ## approximation when
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
95 ## @iftex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
96 ## @tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
97 ## $D_q(a)$
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
98 ## @end tex
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
99 ## @end iftex
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
100 ## @ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
101 ## @code{Dq(a)}
8517
81d6ab3ac93c Allow documentation tobe built for other formats than tex and info
sh@sh-laptop
parents: 8506
diff changeset
102 ## @end ifnottex
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
103 ## is ill-conditioned.
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
104 ## @end deftypefn
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
105
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
106 function r = expm (a)
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
107
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
108 if (! ismatrix (a) || ! issquare (a))
8664
e07e93c04080 style fixes
John W. Eaton <jwe@octave.org>
parents: 8517
diff changeset
109 error ("expm requires a square matrix");
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
110 endif
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
111
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
112 n = rows (a);
8506
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
113 ## Trace reduction.
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
114 a(a == -Inf) = -realmax;
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
115 trshift = trace (a) / length (a);
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
116 if (trshift > 0)
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
117 a -= trshift*eye (n);
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
118 endif
8506
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
119 ## Balancing.
9048
867d5d1aed06 swap out args in balance for M*b compat
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
120 [d, p, aa] = balance (a);
8506
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
121 ## FIXME: can we both permute and scale at once? Or should we rather do
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
122 ## this:
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
123 ##
9048
867d5d1aed06 swap out args in balance for M*b compat
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
124 ## [d, xx, aa] = balance (a, "noperm");
867d5d1aed06 swap out args in balance for M*b compat
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
125 ## [xx, p, aa] = balance (aa, "noscal");
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
126 [f, e] = log2 (norm (aa, "inf"));
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
127 s = max (0, e);
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
128 s = min (s, 1023);
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
129 aa *= 2^(-s);
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
130
8506
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
131 ## Pade approximation for exp(A).
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
132 c = [5.0000000000000000e-1,...
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
133 1.1666666666666667e-1,...
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
134 1.6666666666666667e-2,...
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
135 1.6025641025641026e-3,...
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
136 1.0683760683760684e-4,...
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
137 4.8562548562548563e-6,...
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
138 1.3875013875013875e-7,...
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
139 1.9270852604185938e-9];
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
140
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
141 a2 = aa^2;
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
142 id = eye (n);
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
143 x = (((c(8) * a2 + c(6) * id) * a2 + c(4) * id) * a2 + c(2) * id) * a2 + id;
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
144 y = (((c(7) * a2 + c(5) * id) * a2 + c(3) * id) * a2 + c(1) * id) * aa;
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
145
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
146 r = (x - y) \ (x + y);
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
147
8506
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
148 ## Undo scaling by repeated squaring.
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
149 for k = 1:s
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
150 r ^= 2;
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
151 endfor
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
152
8506
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
153 ## inverse balancing.
8757
79576d40acb6 fix unscaling in expm
Jaroslav Hajek <highegg@gmail.com>
parents: 8664
diff changeset
154 d = diag (d);
79576d40acb6 fix unscaling in expm
Jaroslav Hajek <highegg@gmail.com>
parents: 8664
diff changeset
155 r = d * r / d;
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
156 r = r(p, p);
8506
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8393
diff changeset
157 ## Inverse trace reduction.
8393
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
158 if (trshift >0)
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
159 r *= exp (trshift);
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
160 endif
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
161
c8a785d0e867 add omitted m-file
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
162 endfunction