comparison src/expm.cc @ 1255:fa24599e3d2c

[project @ 1995-04-11 17:49:27 by jwe]
author jwe
date Tue, 11 Apr 1995 17:49:27 +0000
parents 35950c102ac3
children 611d403c7f3d
comparison
equal deleted inserted replaced
1254:ecf3dc595ecb 1255:fa24599e3d2c
44 #include "help.h" 44 #include "help.h"
45 #include "defun-dld.h" 45 #include "defun-dld.h"
46 46
47 extern "C" 47 extern "C"
48 { 48 {
49 double F77_FCN (dlange) (const char*, const int&, const int&, 49 double F77_FCN (dlange, DLANGE) (const char*, const int&,
50 const double*, const int&, double*); 50 const int&, const double*,
51 51 const int&, double*);
52 double F77_FCN (zlange) (const char*, const int&, const int&, 52
53 const Complex*, const int&, double*); 53 double F77_FCN (zlange, ZLANGE) (const char*, const int&,
54 const int&, const Complex*,
55 const int&, double*);
54 } 56 }
55 57
56 DEFUN_DLD_BUILTIN ("expm", Fexpm, Sexpm, 2, 1, 58 DEFUN_DLD_BUILTIN ("expm", Fexpm, Sexpm, 2, 1,
57 "expm (X): matrix exponential, e^A") 59 "expm (X): matrix exponential, e^A")
58 { 60 {
133 Matrix d = mbal.balancing_matrix (); 135 Matrix d = mbal.balancing_matrix ();
134 136
135 // Preconditioning step 3: scaling. 137 // Preconditioning step 3: scaling.
136 138
137 ColumnVector work(nc); 139 ColumnVector work(nc);
138 inf_norm = F77_FCN (dlange) ("I", nc, nc, m.fortran_vec (), nc, 140 inf_norm = F77_FCN (dlange, DLANGE) ("I", nc, nc,
139 work.fortran_vec ()); 141 m.fortran_vec (), nc,
142 work.fortran_vec ());
140 143
141 sqpow = (int) (1.0 + log (inf_norm) / log (2.0)); 144 sqpow = (int) (1.0 + log (inf_norm) / log (2.0));
142 145
143 // Check whether we need to square at all. 146 // Check whether we need to square at all.
144 147
225 ComplexMatrix d = mbal.balancing_matrix (); 228 ComplexMatrix d = mbal.balancing_matrix ();
226 229
227 // Preconditioning step 3: scaling. 230 // Preconditioning step 3: scaling.
228 231
229 ColumnVector work (nc); 232 ColumnVector work (nc);
230 inf_norm = F77_FCN (zlange) ("I", nc, nc, m.fortran_vec (), nc, 233 inf_norm = F77_FCN (zlange, ZLANGE) ("I", nc, nc,
231 work.fortran_vec ()); 234 m.fortran_vec (), nc,
235 work.fortran_vec ());
232 236
233 sqpow = (int) (1.0 + log (inf_norm) / log (2.0)); 237 sqpow = (int) (1.0 + log (inf_norm) / log (2.0));
234 238
235 // Check whether we need to square at all. 239 // Check whether we need to square at all.
236 240