GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
__eigs__.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2005-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <limits>
31 #include <string>
32 
33 #include "Matrix.h"
34 #include "eigs-base.h"
35 #include "unwind-prot.h"
36 
37 #include "defun.h"
38 #include "error.h"
39 #include "errwarn.h"
40 #include "interpreter-private.h"
41 #include "oct-map.h"
42 #include "ov.h"
43 #include "ovl.h"
44 #include "pager.h"
45 #include "parse.h"
46 #include "variables.h"
47 
48 #if defined (HAVE_ARPACK)
49 
50 // Global pointer for user defined function.
52 
53 // Have we warned about imaginary values returned from user function?
54 static bool warned_imaginary = false;
55 
56 // Is this a recursive call?
57 static int call_depth = 0;
58 
60 eigs_func (const ColumnVector& x, int& eigs_error)
61 {
63  octave_value_list args;
64  args(0) = x;
65 
66  if (eigs_fcn.is_defined ())
67  {
69 
70  try
71  {
72  tmp = octave::feval (eigs_fcn, args, 1);
73  }
74  catch (octave::execution_exception& e)
75  {
76  err_user_supplied_eval (e, "eigs");
77  }
78 
79  if (tmp.length () && tmp(0).is_defined ())
80  {
81  if (! warned_imaginary && tmp(0).iscomplex ())
82  {
83  warning ("eigs: ignoring imaginary part returned from user-supplied function");
84  warned_imaginary = true;
85  }
86 
87  retval = tmp(0).xvector_value ("eigs: evaluation of user-supplied function failed");
88  }
89  else
90  {
91  eigs_error = 1;
92  err_user_supplied_eval ("eigs");
93  }
94  }
95 
96  return retval;
97 }
98 
100 eigs_complex_func (const ComplexColumnVector& x, int& eigs_error)
101 {
103  octave_value_list args;
104  args(0) = x;
105 
106  if (eigs_fcn.is_defined ())
107  {
108  octave_value_list tmp;
109 
110  try
111  {
112  tmp = octave::feval (eigs_fcn, args, 1);
113  }
114  catch (octave::execution_exception& e)
115  {
116  err_user_supplied_eval (e, "eigs");
117  }
118 
119  if (tmp.length () && tmp(0).is_defined ())
120  {
121  retval = tmp(0).xcomplex_vector_value ("eigs: evaluation of user-supplied function failed");
122  }
123  else
124  {
125  eigs_error = 1;
126  err_user_supplied_eval ("eigs");
127  }
128  }
129 
130  return retval;
131 }
132 
133 #endif
134 
135 DEFMETHOD (__eigs__, interp, args, nargout,
136  doc: /* -*- texinfo -*-
137 @deftypefn {} {@var{d} =} __eigs__ (@var{A})
138 @deftypefnx {} {@var{d} =} __eigs__ (@var{A}, @var{k})
139 @deftypefnx {} {@var{d} =} __eigs__ (@var{A}, @var{k}, @var{sigma})
140 @deftypefnx {} {@var{d} =} __eigs__ (@var{A}, @var{k}, @var{sigma}, @var{opts})
141 @deftypefnx {} {@var{d} =} __eigs__ (@var{A}, @var{B})
142 @deftypefnx {} {@var{d} =} __eigs__ (@var{A}, @var{B}, @var{k})
143 @deftypefnx {} {@var{d} =} __eigs__ (@var{A}, @var{B}, @var{k}, @var{sigma})
144 @deftypefnx {} {@var{d} =} __eigs__ (@var{A}, @var{B}, @var{k}, @var{sigma}, @var{opts})
145 @deftypefnx {} {@var{d} =} __eigs__ (@var{af}, @var{n})
146 @deftypefnx {} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{B})
147 @deftypefnx {} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{k})
148 @deftypefnx {} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{B}, @var{k})
149 @deftypefnx {} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{k}, @var{sigma})
150 @deftypefnx {} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{B}, @var{k}, @var{sigma})
151 @deftypefnx {} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{k}, @var{sigma}, @var{opts})
152 @deftypefnx {} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{B}, @var{k}, @var{sigma}, @var{opts})
153 @deftypefnx {} {[@var{V}, @var{d}] =} __eigs__ (@var{A}, @dots{})
154 @deftypefnx {} {[@var{V}, @var{d}] =} __eigs__ (@var{af}, @var{n}, @dots{})
155 @deftypefnx {} {[@var{V}, @var{d}, @var{flag}] =} __eigs__ (@var{A}, @dots{})
156 @deftypefnx {} {[@var{V}, @var{d}, @var{flag}] =} __eigs__ (@var{af}, @var{n}, @dots{})
157 Undocumented internal function.
158 @end deftypefn */)
159 {
160 #if defined (HAVE_ARPACK)
161 
162  int nargin = args.length ();
163 
164  if (nargin == 0)
165  print_usage ();
166 
168 
169  std::string fcn_name;
170  octave_idx_type n = 0;
171  octave_idx_type k = 6;
172  Complex sigma = 0.0;
173  double sigmar, sigmai;
174  bool have_sigma = false;
175  std::string typ = "LM";
176  Matrix amm, bmm, bmt;
177  ComplexMatrix acm, bcm, bct;
178  SparseMatrix asmm, bsmm, bsmt;
179  SparseComplexMatrix ascm, bscm, bsct;
180  int b_arg = 0;
181  bool have_b = false;
182  bool have_a_fun = false;
183  bool a_is_complex = false;
184  bool b_is_complex = false;
185  bool symmetric = false;
186  bool sym_tested = false;
187  bool cholB = false;
188  bool a_is_sparse = false;
189  bool b_is_sparse = false;
190  ColumnVector permB;
191  int arg_offset = 0;
192  double tol = std::numeric_limits<double>::epsilon ();
193  int maxit = 300;
194  int disp = 0;
195  octave_idx_type p = -1;
196  ColumnVector resid;
197  ComplexColumnVector cresid;
198  octave_idx_type info = 1;
199 
200  warned_imaginary = false;
201 
203 
204  frame.protect_var (call_depth);
205  call_depth++;
206 
207  if (call_depth > 1)
208  error ("eigs: invalid recursive call");
209 
210  if (args(0).is_function_handle () || args(0).is_inline_function ()
211  || args(0).is_string ())
212  {
213  eigs_fcn = octave::get_function_handle (interp, args(0), "x");
214 
215  if (eigs_fcn.is_undefined ())
216  error ("eigs: unknown function");
217 
218  if (nargin < 2)
219  error ("eigs: incorrect number of arguments");
220 
221  n = args(1).nint_value ();
222  arg_offset = 1;
223  have_a_fun = true;
224  }
225  else
226  {
227  if (args(0).iscomplex ())
228  {
229  if (args(0).issparse ())
230  {
231  ascm = (args(0).sparse_complex_matrix_value ());
232  a_is_sparse = true;
233  }
234  else
235  acm = (args(0).complex_matrix_value ());
236  a_is_complex = true;
237  }
238  else
239  {
240  if (args(0).issparse ())
241  {
242  asmm = (args(0).sparse_matrix_value ());
243  a_is_sparse = true;
244  }
245  else
246  {
247  amm = (args(0).matrix_value ());
248  }
249  }
250  }
251 
252  // Note hold off reading B until later to avoid issues of double
253  // copies of the matrix if B is full/real while A is complex.
254  if (nargin > 1 + arg_offset
255  && ! (args(1 + arg_offset).is_real_scalar ()))
256  {
257  if (args(1+arg_offset).iscomplex ())
258  {
259  b_arg = 1+arg_offset;
260  if (args(b_arg).issparse ())
261  {
262  bscm = (args(b_arg).sparse_complex_matrix_value ());
263  b_is_sparse = true;
264  }
265  else
266  bcm = (args(b_arg).complex_matrix_value ());
267  have_b = true;
268  b_is_complex = true;
269  arg_offset++;
270  }
271  else
272  {
273  b_arg = 1+arg_offset;
274  if (args(b_arg).issparse ())
275  {
276  bsmm = (args(b_arg).sparse_matrix_value ());
277  b_is_sparse = true;
278  }
279  else
280  bmm = (args(b_arg).matrix_value ());
281  have_b = true;
282  arg_offset++;
283  }
284  }
285 
286  if (nargin > (1+arg_offset))
287  k = args(1+arg_offset).nint_value ();
288 
289  if (nargin > (2+arg_offset))
290  {
291  if (args(2+arg_offset).is_string ())
292  {
293  typ = args(2+arg_offset).string_value ();
294 
295  // Use STL function to convert to upper case
296  transform (typ.begin (), typ.end (), typ.begin (), toupper);
297 
298  sigma = 0.0;
299  }
300  else
301  {
302  sigma = args(2+arg_offset).xcomplex_value ("eigs: SIGMA must be a scalar or a string");
303 
304  have_sigma = true;
305  }
306  }
307 
308  sigmar = sigma.real ();
309  sigmai = sigma.imag ();
310 
311  if (nargin > (3+arg_offset))
312  {
313  if (! args(3+arg_offset).isstruct ())
314  error ("eigs: OPTS argument must be a structure");
315 
316  octave_scalar_map map = args(3+arg_offset).xscalar_map_value ("eigs: OPTS argument must be a scalar structure");
317 
318  octave_value tmp;
319 
320  // issym is ignored for complex matrix inputs
321  tmp = map.getfield ("issym");
322  if (tmp.is_defined ())
323  {
324  if (tmp.numel () != 1)
325  error ("eigs: OPTS.issym must be a scalar value");
326 
327  symmetric = tmp.xbool_value ("eigs: OPTS.issym must be a logical value");
328  sym_tested = true;
329  }
330 
331  // isreal is ignored if A is not a function
332  if (have_a_fun)
333  {
334  tmp = map.getfield ("isreal");
335  if (tmp.is_defined ())
336  {
337  if (tmp.numel () != 1)
338  error ("eigs: OPTS.isreal must be a scalar value");
339 
340  a_is_complex = ! tmp.xbool_value ("eigs: OPTS.isreal must be a logical value");
341  }
342  }
343 
344  tmp = map.getfield ("tol");
345  if (tmp.is_defined ())
346  tol = tmp.double_value ();
347 
348  tmp = map.getfield ("maxit");
349  if (tmp.is_defined ())
350  maxit = tmp.nint_value ();
351 
352  tmp = map.getfield ("p");
353  if (tmp.is_defined ())
354  p = tmp.nint_value ();
355 
356  tmp = map.getfield ("v0");
357  if (tmp.is_defined ())
358  {
359  if (a_is_complex || b_is_complex)
360  cresid = ComplexColumnVector (tmp.complex_vector_value ());
361  else
362  resid = ColumnVector (tmp.vector_value ());
363  }
364 
365  tmp = map.getfield ("disp");
366  if (tmp.is_defined ())
367  disp = tmp.nint_value ();
368 
369  tmp = map.getfield ("cholB");
370  if (tmp.is_defined ())
371  {
372  if (tmp.numel () != 1)
373  error ("eigs: OPTS.cholB must be a scalar value");
374 
375  cholB = tmp.xbool_value ("eigs: OPTS.cholB must be a logical value");
376  }
377 
378  tmp = map.getfield ("permB");
379  if (tmp.is_defined ())
380  permB = ColumnVector (tmp.vector_value ()) - 1.0;
381  }
382 
383  if (nargin > (4+arg_offset))
384  error ("eigs: incorrect number of arguments");
385 
386  // Test undeclared (no issym) matrix inputs for symmetry
387  if (! sym_tested && ! have_a_fun)
388  {
389  if (a_is_complex)
390  {
391  if (a_is_sparse)
392  symmetric = ascm.ishermitian ();
393  else
394  symmetric = acm.ishermitian ();
395  }
396  else
397  {
398  if (a_is_sparse)
399  symmetric = asmm.issymmetric ();
400  else
401  symmetric = amm.issymmetric ();
402  }
403  }
404 
405  if (have_b)
406  {
407  if (a_is_complex || b_is_complex)
408  {
409  if (b_is_sparse)
410  bscm = args(b_arg).sparse_complex_matrix_value ();
411  else
412  bcm = args(b_arg).complex_matrix_value ();
413  }
414  else
415  {
416  if (b_is_sparse)
417  bsmm = args(b_arg).sparse_matrix_value ();
418  else
419  bmm = args(b_arg).matrix_value ();
420  }
421  }
422 
423  // Mode 1 for SM mode seems unstable for some reason.
424  // Use Mode 3 instead, with sigma = 0.
425  if (! have_sigma && typ == "SM")
426  have_sigma = true;
427 
428  octave_idx_type nconv;
429  if (a_is_complex || b_is_complex)
430  {
431  ComplexMatrix eig_vec;
432  ComplexColumnVector eig_val;
433 
434  if (have_a_fun)
435  {
436  if (b_is_sparse)
438  (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec,
439  eig_val, bscm, permB, cresid, octave_stdout, tol,
440  (nargout > 1), cholB, disp, maxit);
441  else
443  (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec,
444  eig_val, bcm, permB, cresid, octave_stdout, tol,
445  (nargout > 1), cholB, disp, maxit);
446  }
447  else if (have_sigma)
448  {
449  if (a_is_sparse)
451  (ascm, sigma, k, p, info, eig_vec, eig_val, bscm, permB,
452  cresid, octave_stdout, tol, (nargout > 1), cholB, disp,
453  maxit);
454  else
456  (acm, sigma, k, p, info, eig_vec, eig_val, bcm, permB,
457  cresid, octave_stdout, tol, (nargout > 1), cholB, disp,
458  maxit);
459  }
460  else
461  {
462  if (a_is_sparse)
464  (ascm, typ, k, p, info, eig_vec, eig_val, bscm, permB,
465  cresid, octave_stdout, tol, (nargout > 1), cholB, disp,
466  maxit);
467  else
469  (acm, typ, k, p, info, eig_vec, eig_val, bcm, permB,
470  cresid, octave_stdout, tol, (nargout > 1), cholB, disp,
471  maxit);
472  }
473 
474  if (nargout < 2)
475  {
476  if (symmetric)
477  retval(0) = real (eig_val);
478  else
479  retval(0) = eig_val;
480  }
481  else
482  {
483  if (symmetric)
484  retval = ovl (eig_vec, DiagMatrix (real (eig_val)), double (info));
485  else
486  retval = ovl (eig_vec, ComplexDiagMatrix (eig_val), double (info));
487  }
488  }
489  else if (sigmai != 0.0)
490  {
491  // Promote real problem to a complex one.
492  ComplexMatrix eig_vec;
493  ComplexColumnVector eig_val;
494 
495  if (have_a_fun)
496  {
497  if (b_is_sparse)
499  (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec,
500  eig_val, bscm, permB, cresid, octave_stdout, tol,
501  (nargout > 1), cholB, disp, maxit);
502  else
504  (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec,
505  eig_val, bcm, permB, cresid, octave_stdout, tol,
506  (nargout > 1), cholB, disp, maxit);
507  }
508  else
509  {
510  if (a_is_sparse)
512  (SparseComplexMatrix (asmm), sigma, k, p, info, eig_vec,
513  eig_val, SparseComplexMatrix (bsmm), permB, cresid,
514  octave_stdout, tol, (nargout > 1), cholB, disp, maxit);
515  else
517  (ComplexMatrix (amm), sigma, k, p, info, eig_vec,
518  eig_val, ComplexMatrix (bmm), permB, cresid,
519  octave_stdout, tol, (nargout > 1), cholB, disp, maxit);
520  }
521 
522  if (nargout < 2)
523  {
524  if (symmetric)
525  retval(0) = real (eig_val);
526  else
527  retval(0) = eig_val;
528  }
529  else
530  {
531  if (symmetric)
532  retval = ovl (eig_vec, DiagMatrix (real (eig_val)), double (info));
533  else
534  retval = ovl (eig_vec, ComplexDiagMatrix (eig_val), double (info));
535  }
536  }
537  else
538  {
539  if (symmetric)
540  {
541  Matrix eig_vec;
542  ColumnVector eig_val;
543 
544  if (have_a_fun)
545  {
546  if (b_is_sparse)
547  nconv = EigsRealSymmetricFunc
548  (eigs_func, n, typ, sigmar, k, p, info, eig_vec,
549  eig_val, bsmm, permB, resid, octave_stdout, tol,
550  (nargout > 1), cholB, disp, maxit);
551  else
552  nconv = EigsRealSymmetricFunc
553  (eigs_func, n, typ, sigmar, k, p, info, eig_vec,
554  eig_val, bmm, permB, resid, octave_stdout, tol,
555  (nargout > 1), cholB, disp, maxit);
556  }
557  else if (have_sigma)
558  {
559  if (a_is_sparse)
561  (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm,
562  permB, resid, octave_stdout, tol, (nargout > 1),
563  cholB, disp, maxit);
564  else
566  (amm, sigmar, k, p, info, eig_vec, eig_val, bmm,
567  permB, resid, octave_stdout, tol, (nargout > 1),
568  cholB, disp, maxit);
569  }
570  else
571  {
572  if (a_is_sparse)
574  (asmm, typ, k, p, info, eig_vec, eig_val, bsmm,
575  permB, resid, octave_stdout, tol, (nargout > 1),
576  cholB, disp, maxit);
577  else
579  (amm, typ, k, p, info, eig_vec, eig_val, bmm, permB,
580  resid, octave_stdout, tol, (nargout > 1), cholB,
581  disp, maxit);
582  }
583 
584  if (nargout < 2)
585  retval(0) = eig_val;
586  else
587  retval = ovl (eig_vec, DiagMatrix (eig_val), double (info));
588  }
589  else
590  {
591  ComplexMatrix eig_vec;
592  ComplexColumnVector eig_val;
593 
594  if (have_a_fun)
595  {
596  if (b_is_sparse)
598  (eigs_func, n, typ, sigmar, k, p, info, eig_vec,
599  eig_val, bsmm, permB, resid, octave_stdout, tol,
600  (nargout > 1), cholB, disp, maxit);
601  else
603  (eigs_func, n, typ, sigmar, k, p, info, eig_vec,
604  eig_val, bmm, permB, resid, octave_stdout, tol,
605  (nargout > 1), cholB, disp, maxit);
606  }
607  else if (have_sigma)
608  {
609  if (a_is_sparse)
611  (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm,
612  permB, resid, octave_stdout, tol, (nargout > 1),
613  cholB, disp, maxit);
614  else
616  (amm, sigmar, k, p, info, eig_vec, eig_val, bmm,
617  permB, resid, octave_stdout, tol, (nargout > 1),
618  cholB, disp, maxit);
619  }
620  else
621  {
622  if (a_is_sparse)
624  (asmm, typ, k, p, info, eig_vec, eig_val, bsmm,
625  permB, resid, octave_stdout, tol, (nargout > 1),
626  cholB, disp, maxit);
627  else
629  (amm, typ, k, p, info, eig_vec, eig_val, bmm, permB,
630  resid, octave_stdout, tol, (nargout > 1), cholB,
631  disp, maxit);
632  }
633 
634  if (nargout < 2)
635  retval(0) = eig_val;
636  else
637  retval = ovl (eig_vec, ComplexDiagMatrix (eig_val), double (info));
638  }
639  }
640 
641  if (nconv <= 0)
642  warning_with_id ("Octave:eigs:UnconvergedEigenvalues",
643  "eigs: None of the %" OCTAVE_IDX_TYPE_FORMAT
644  " requested eigenvalues converged", k);
645  else if (nconv < k)
646  warning_with_id ("Octave:eigs:UnconvergedEigenvalues",
647  "eigs: Only %" OCTAVE_IDX_TYPE_FORMAT
648  " of the %" OCTAVE_IDX_TYPE_FORMAT
649  " requested eigenvalues converged",
650  nconv, k);
651 
652  if (! fcn_name.empty ())
653  {
654  octave::symbol_table& symtab = interp.get_symbol_table ();
655 
656  symtab.clear_function (fcn_name);
657  }
658 
659  return retval;
660 
661 #else
662 
663  octave_unused_parameter (interp);
664  octave_unused_parameter (args);
665  octave_unused_parameter (nargout);
666 
667  err_disabled_feature ("eigs", "ARPACK");
668 
669 #endif
670 }
671 
672 /*
673 ## No test needed for internal helper function.
674 %!assert (1)
675 */
static int call_depth
Definition: __eigs__.cc:57
static bool warned_imaginary
Definition: __eigs__.cc:54
static octave_value eigs_fcn
Definition: __eigs__.cc:51
ColumnVector eigs_func(const ColumnVector &x, int &eigs_error)
Definition: __eigs__.cc:60
ComplexColumnVector eigs_complex_func(const ComplexColumnVector &x, int &eigs_error)
Definition: __eigs__.cc:100
bool ishermitian(void) const
Definition: CMatrix.cc:174
Definition: dMatrix.h:42
bool issymmetric(void) const
Definition: dMatrix.cc:136
bool ishermitian(void) const
Definition: CSparse.cc:142
bool issymmetric(void) const
Definition: dSparse.cc:131
void clear_function(const std::string &name)
Definition: symtab.cc:434
octave_value getfield(const std::string &key) const
Definition: oct-map.cc:183
octave_idx_type length(void) const
Definition: ovl.h:113
octave_idx_type numel(void) const
Definition: ov.h:518
bool xbool_value(const char *fmt,...) const
bool is_defined(void) const
Definition: ov.h:551
int nint_value(bool frc_str_conv=false) const
Definition: ov.h:772
Array< double > vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
bool is_undefined(void) const
Definition: ov.h:554
Array< Complex > complex_vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
double double_value(bool frc_str_conv=false) const
Definition: ov.h:794
ColumnVector real(const ComplexColumnVector &a)
Definition: dColVector.cc:137
OCTINTERP_API void print_usage(void)
Definition: defun.cc:53
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
Definition: defun.h:138
octave_idx_type EigsRealSymmetricFunc(EigsFunc fun, octave_idx_type n_arg, const std::string &_typ, double sigma, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, const M &_b, ColumnVector &permB, ColumnVector &resid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:1380
octave_idx_type EigsRealNonSymmetricMatrixShift(const M &m, double sigmar, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, const M &_b, ColumnVector &permB, ColumnVector &resid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:2112
octave_idx_type EigsRealSymmetricMatrixShift(const M &m, double sigma, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, const M &_b, ColumnVector &permB, ColumnVector &resid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:1077
octave_idx_type EigsRealNonSymmetricMatrix(const M &m, const std::string typ, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, const M &_b, ColumnVector &permB, ColumnVector &resid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:1761
octave_idx_type EigsComplexNonSymmetricMatrix(const M &m, const std::string typ, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, const M &_b, ColumnVector &permB, ComplexColumnVector &cresid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:2926
octave_idx_type EigsComplexNonSymmetricFunc(EigsComplexFunc fun, octave_idx_type n_arg, const std::string &_typ, Complex sigma, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, const M &_b, ColumnVector &permB, ComplexColumnVector &cresid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:3552
octave_idx_type EigsRealNonSymmetricFunc(EigsFunc fun, octave_idx_type n_arg, const std::string &_typ, double sigmar, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, const M &_b, ColumnVector &permB, ColumnVector &resid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:2484
octave_idx_type EigsComplexNonSymmetricMatrixShift(const M &m, Complex sigma, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, const M &_b, ColumnVector &permB, ComplexColumnVector &cresid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:3229
octave_idx_type EigsRealSymmetricMatrix(const M &m, const std::string typ, octave_idx_type k_arg, octave_idx_type p_arg, octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, const M &_b, ColumnVector &permB, ColumnVector &resid, std::ostream &os, double tol, bool rvec, bool cholB, int disp, int maxit)
Definition: eigs-base.cc:785
void warning(const char *fmt,...)
Definition: error.cc:1050
void warning_with_id(const char *id, const char *fmt,...)
Definition: error.cc:1065
void error(const char *fmt,...)
Definition: error.cc:968
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
Definition: errwarn.cc:53
void err_user_supplied_eval(const char *name)
Definition: errwarn.cc:152
ColumnVector transform(const Matrix &m, double x, double y, double z)
Definition: graphics.cc:5814
F77_RET_T const F77_DBLE * x
octave_idx_type n
Definition: mx-inlines.cc:753
octave_value get_function_handle(interpreter &interp, const octave_value &arg, const std::string &parameter_name)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
Definition: oct-parse.cc:9580
std::complex< double > Complex
Definition: oct-cmplx.h:33
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
Definition: ovl.h:211
#define octave_stdout
Definition: pager.h:313