annotate libinterp/dldfcn/__eigs__.cc @ 20790:c2d9556d51d0

eliminate return statements after calls to print_usage * __delaunayn__.cc, __eigs__.cc, __glpk__.cc, __magick_read__.cc, __osmesa_print__.cc, __voronoi__.cc, amd.cc, audiodevinfo.cc, audioread.cc, chol.cc, colamd.cc, convhulln.cc, dmperm.cc, fftw.cc, qr.cc, symbfact.cc, symrcm.cc: Eliminate return statements after calls to print_usage.
author John W. Eaton <jwe@octave.org>
date Thu, 03 Dec 2015 12:15:38 -0500
parents b6f2909e7f94
children 66cd994d1b79
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
1 /*
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
3 Copyright (C) 2005-2015 David Bateman
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
4
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
5 This file is part of Octave.
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
6
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
10 option) any later version.
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
11
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
15 for more details.
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
16
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
20
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
21 */
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
22
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
24 #include <config.h>
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
25 #endif
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
26
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
27 #include "ov.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
28 #include "defun-dld.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
29 #include "error.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
30 #include "gripes.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
31 #include "quit.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
32 #include "variables.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
33 #include "ov-re-sparse.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
34 #include "ov-cx-sparse.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
35 #include "oct-map.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
36 #include "pager.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
37 #include "unwind-prot.h"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
38
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
39 #include "eigs-base.cc"
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
40
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
41 // Global pointer for user defined function.
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
42 static octave_function *eigs_fcn = 0;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
43
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
44 // Have we warned about imaginary values returned from user function?
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
45 static bool warned_imaginary = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
46
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
47 // Is this a recursive call?
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
48 static int call_depth = 0;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
49
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
50 ColumnVector
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
51 eigs_func (const ColumnVector &x, int &eigs_error)
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
52 {
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
53 ColumnVector retval;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
54 octave_value_list args;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
55 args(0) = x;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
56
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
57 if (eigs_fcn)
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
58 {
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
59 octave_value_list tmp;
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
60
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
61 try
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
62 {
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
63 tmp = eigs_fcn->do_multi_index_op (1, args);
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
64 }
20785
b6f2909e7f94 always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents: 20756
diff changeset
65 catch (octave_execution_exception& e)
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
66 {
20756
200ae1d650b7 propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents: 20743
diff changeset
67 gripe_user_supplied_eval (e, "eigs");
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
68 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
69
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
70 if (tmp.length () && tmp(0).is_defined ())
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
71 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
72 if (! warned_imaginary && tmp(0).is_complex_type ())
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
73 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
74 warning ("eigs: ignoring imaginary part returned from user-supplied function");
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
75 warned_imaginary = true;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
76 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
77
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
78 retval = tmp(0).xvector_value ("eigs: evaluation of user-supplied function failed");
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
79 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
80 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
81 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
82 eigs_error = 1;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
83 gripe_user_supplied_eval ("eigs");
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
84 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
85 }
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
86
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
87 return retval;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
88 }
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
89
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
90 ComplexColumnVector
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
91 eigs_complex_func (const ComplexColumnVector &x, int &eigs_error)
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
92 {
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
93 ComplexColumnVector retval;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
94 octave_value_list args;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
95 args(0) = x;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
96
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
97 if (eigs_fcn)
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
98 {
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
99 octave_value_list tmp;
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
100
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
101 try
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
102 {
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
103 tmp = eigs_fcn->do_multi_index_op (1, args);
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
104 }
20785
b6f2909e7f94 always throw exception after debugging with debug_on_error
John W. Eaton <jwe@octave.org>
parents: 20756
diff changeset
105 catch (octave_execution_exception& e)
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
106 {
20756
200ae1d650b7 propagate octave_execution_exception objects through try/catch blocks
John W. Eaton <jwe@octave.org>
parents: 20743
diff changeset
107 gripe_user_supplied_eval (e, "eigs");
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
108 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
109
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
110 if (tmp.length () && tmp(0).is_defined ())
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
111 {
20743
b6408331bfa2 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20703
diff changeset
112 retval = tmp(0).complex_vector_value ("eigs: evaluation of user-supplied function failed");
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
113 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
114 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
115 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
116 eigs_error = 1;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
117 gripe_user_supplied_eval ("eigs");
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
118 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
119 }
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
120
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
121 return retval;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
122 }
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
123
17220
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
124 DEFUN_DLD (__eigs__, args, nargout,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
125 "-*- texinfo -*-\n\
17220
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
126 @deftypefn {Loadable Function} {@var{d} =} __eigs__ (@var{A})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
127 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{k})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
128 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{k}, @var{sigma})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
129 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{k}, @var{sigma}, @var{opts})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
130 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{B})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
131 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{B}, @var{k})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
132 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{B}, @var{k}, @var{sigma})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
133 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{B}, @var{k}, @var{sigma}, @var{opts})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
134 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{af}, @var{n})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
135 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{B})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
136 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{k})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
137 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{B}, @var{k})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
138 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{k}, @var{sigma})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
139 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{B}, @var{k}, @var{sigma})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
140 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{k}, @var{sigma}, @var{opts})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
141 @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{af}, @var{n}, @var{B}, @var{k}, @var{sigma}, @var{opts})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
142 @deftypefnx {Loadable Function} {[@var{V}, @var{d}] =} __eigs__ (@var{A}, @dots{})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
143 @deftypefnx {Loadable Function} {[@var{V}, @var{d}] =} __eigs__ (@var{af}, @var{n}, @dots{})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
144 @deftypefnx {Loadable Function} {[@var{V}, @var{d}, @var{flag}] =} __eigs__ (@var{A}, @dots{})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
145 @deftypefnx {Loadable Function} {[@var{V}, @var{d}, @var{flag}] =} __eigs__ (@var{af}, @var{n}, @dots{})\n\
ea9992fd9c89 fix eigs to handle small matrices
John W. Eaton <jwe@octave.org>
parents: 15220
diff changeset
146 Undocumented internal function.\n\
9724
f22bbc5d56e9 Fix various incorrect usages of TeXinfo deffn and deftypefn macros
Rik <rdrider0-list@yahoo.com>
parents: 9597
diff changeset
147 @end deftypefn")
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
148 {
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
149 octave_value_list retval;
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
150 #ifdef HAVE_ARPACK
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
151 int nargin = args.length ();
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
152 std::string fcn_name;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
153 octave_idx_type n = 0;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
154 octave_idx_type k = 6;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
155 Complex sigma = 0.;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
156 double sigmar, sigmai;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
157 bool have_sigma = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
158 std::string typ = "LM";
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
159 Matrix amm, bmm, bmt;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
160 ComplexMatrix acm, bcm, bct;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
161 SparseMatrix asmm, bsmm, bsmt;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
162 SparseComplexMatrix ascm, bscm, bsct;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
163 int b_arg = 0;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
164 bool have_b = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
165 bool have_a_fun = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
166 bool a_is_complex = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
167 bool b_is_complex = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
168 bool symmetric = false;
12649
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
169 bool sym_tested = false;
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
170 bool cholB = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
171 bool a_is_sparse = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
172 ColumnVector permB;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
173 int arg_offset = 0;
15220
61822c866ba1 use std::numeric_limits<T>::epsilon in C++ code
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
174 double tol = std::numeric_limits<double>::epsilon ();
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
175 int maxit = 300;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
176 int disp = 0;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
177 octave_idx_type p = -1;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
178 ColumnVector resid;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
179 ComplexColumnVector cresid;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
180 octave_idx_type info = 1;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
181
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
182 warned_imaginary = false;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
183
10066
2cd940306a06 make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents: 9758
diff changeset
184 unwind_protect frame;
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
185
10066
2cd940306a06 make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents: 9758
diff changeset
186 frame.protect_var (call_depth);
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
187 call_depth++;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
188
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
189 if (call_depth > 1)
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
190 {
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
191 error ("eigs: invalid recursive call");
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14844
diff changeset
192 if (fcn_name.length ())
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
193 clear_function (fcn_name);
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
194 return retval;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
195 }
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
196
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
197 if (nargin == 0)
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
198 print_usage ();
20790
c2d9556d51d0 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20785
diff changeset
199
c2d9556d51d0 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20785
diff changeset
200 if (args(0).is_function_handle () || args(0).is_inline_function ()
c2d9556d51d0 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20785
diff changeset
201 || args(0).is_string ())
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
202 {
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
203 if (args(0).is_string ())
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
204 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
205 std::string name = args(0).string_value ();
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
206 std::string fname = "function y = ";
18862
6825522c25e4 maint: Use names beginning and ending with "__" for internal only functions.
Rik <rik@octave.org>
parents: 17787
diff changeset
207 fcn_name = unique_symbol_name ("__eigs_fcn__");
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
208 fname.append (fcn_name);
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
209 fname.append ("(x) y = ");
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
210 eigs_fcn = extract_function (args(0), "eigs", fcn_name, fname,
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
211 "; endfunction");
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
212 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
213 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
214 eigs_fcn = args(0).function_value ();
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
215
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
216 if (!eigs_fcn)
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
217 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
218 error ("eigs: unknown function");
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
219 return retval;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
220 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
221
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
222 if (nargin < 2)
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
223 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
224 error ("eigs: incorrect number of arguments");
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
225 return retval;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
226 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
227 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
228 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
229 n = args(1).nint_value ();
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
230 arg_offset = 1;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
231 have_a_fun = true;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
232 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
233 }
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
234 else
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
235 {
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
236 if (args(0).is_complex_type ())
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
237 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
238 if (args(0).is_sparse_type ())
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
239 {
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14844
diff changeset
240 ascm = (args(0).sparse_complex_matrix_value ());
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
241 a_is_sparse = true;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
242 }
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
243 else
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14844
diff changeset
244 acm = (args(0).complex_matrix_value ());
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
245 a_is_complex = true;
12649
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
246 symmetric = false; // ARPACK doesn't special case complex symmetric
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
247 sym_tested = true;
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
248 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
249 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
250 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
251 if (args(0).is_sparse_type ())
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
252 {
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14844
diff changeset
253 asmm = (args(0).sparse_matrix_value ());
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
254 a_is_sparse = true;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
255 }
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
256 else
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
257 {
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14844
diff changeset
258 amm = (args(0).matrix_value ());
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
259 }
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
260 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
261
9593
cf8403208c43 Fix nesting error in options parsing of eigs
David Bateman <dbateman@free.fr>
parents: 9377
diff changeset
262 }
cf8403208c43 Fix nesting error in options parsing of eigs
David Bateman <dbateman@free.fr>
parents: 9377
diff changeset
263
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11553
diff changeset
264 // Note hold off reading B till later to avoid issues of double
12649
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
265 // copies of the matrix if B is full/real while A is complex.
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
266 if (nargin > 1 + arg_offset
19864
17d647821d61 maint: More cleanup of C++ code to follow Octave coding conventions.
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
267 && ! (args(1 + arg_offset).is_real_scalar ()))
9593
cf8403208c43 Fix nesting error in options parsing of eigs
David Bateman <dbateman@free.fr>
parents: 9377
diff changeset
268 {
cf8403208c43 Fix nesting error in options parsing of eigs
David Bateman <dbateman@free.fr>
parents: 9377
diff changeset
269 if (args(1+arg_offset).is_complex_type ())
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
270 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
271 b_arg = 1+arg_offset;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
272 have_b = true;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
273 b_is_complex = true;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
274 arg_offset++;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
275 }
9593
cf8403208c43 Fix nesting error in options parsing of eigs
David Bateman <dbateman@free.fr>
parents: 9377
diff changeset
276 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
277 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
278 b_arg = 1+arg_offset;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
279 have_b = true;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
280 arg_offset++;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
281 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
282 }
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
283
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
284 if (nargin > (1+arg_offset))
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
285 k = args(1+arg_offset).nint_value ();
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
286
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
287 if (nargin > (2+arg_offset))
8683
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
288 {
8845
5a6db6bd1a02 eigs.cc (Feigs): fix handling of sigma arg
John W. Eaton <jwe@octave.org>
parents: 8702
diff changeset
289 if (args(2+arg_offset).is_string ())
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
290 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
291 typ = args(2+arg_offset).string_value ();
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
292
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
293 // Use STL function to convert to upper case
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
294 transform (typ.begin (), typ.end (), typ.begin (), toupper);
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
295
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
296 sigma = 0.;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
297 }
8683
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
298 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
299 {
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
300 sigma = args(2+arg_offset).xcomplex_value ("eigs: SIGMA must be a scalar or a string");
8845
5a6db6bd1a02 eigs.cc (Feigs): fix handling of sigma arg
John W. Eaton <jwe@octave.org>
parents: 8702
diff changeset
301
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
302 have_sigma = true;
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
303 }
8683
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
304 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
305
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
306 sigmar = std::real (sigma);
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
307 sigmai = std::imag (sigma);
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
308
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
309 if (nargin > (3+arg_offset))
8683
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
310 {
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
311 if (args(3+arg_offset).is_map ())
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
312 {
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
313 octave_scalar_map map = args(3+arg_offset).xscalar_map_value ("eigs: OPTS argument must be a scalar structure");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
314
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
315 octave_value tmp;
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
316
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
317 // issym is ignored for complex matrix inputs
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
318 tmp = map.getfield ("issym");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
319 if (tmp.is_defined () && !sym_tested)
11044
757249bb4888 eigs.cc: use octave_scalar_map instead of Octave_map
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
320 {
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
321 symmetric = tmp.double_value () != 0.;
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
322 sym_tested = true;
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
323 }
11044
757249bb4888 eigs.cc: use octave_scalar_map instead of Octave_map
John W. Eaton <jwe@octave.org>
parents: 10846
diff changeset
324
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
325 // isreal is ignored if A is not a function
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
326 tmp = map.getfield ("isreal");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
327 if (tmp.is_defined () && have_a_fun)
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
328 a_is_complex = ! (tmp.double_value () != 0.);
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
329
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
330 tmp = map.getfield ("tol");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
331 if (tmp.is_defined ())
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
332 tol = tmp.double_value ();
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
333
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
334 tmp = map.getfield ("maxit");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
335 if (tmp.is_defined ())
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
336 maxit = tmp.nint_value ();
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
337
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
338 tmp = map.getfield ("p");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
339 if (tmp.is_defined ())
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
340 p = tmp.nint_value ();
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
341
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
342 tmp = map.getfield ("v0");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
343 if (tmp.is_defined ())
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
344 {
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
345 if (a_is_complex || b_is_complex)
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
346 cresid = ComplexColumnVector (tmp.complex_vector_value ());
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
347 else
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
348 resid = ColumnVector (tmp.vector_value ());
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
349 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
350
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
351 tmp = map.getfield ("disp");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
352 if (tmp.is_defined ())
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
353 disp = tmp.nint_value ();
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
354
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
355 tmp = map.getfield ("cholB");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
356 if (tmp.is_defined ())
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
357 cholB = tmp.double_value () != 0.;
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
358
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
359 tmp = map.getfield ("permB");
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
360 if (tmp.is_defined ())
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
361 permB = ColumnVector (tmp.vector_value ()) - 1.0;
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
362 }
8683
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
363 else
20703
85e5efae848a eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20687
diff changeset
364 error ("eigs: OPTS argument must be a structure");
8683
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
365 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
366
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
367 if (nargin > (4+arg_offset))
8683
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
368 {
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
369 error ("eigs: incorrect number of arguments");
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
370 return retval;
e4f89f4a7cf8 eigs.cc (Feigs): avoid warnings; style fixes; return after errors
John W. Eaton <jwe@octave.org>
parents: 8585
diff changeset
371 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
372
12649
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
373 // Test undeclared (no issym) matrix inputs for symmetry
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
374 if (!sym_tested && !have_a_fun)
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
375 {
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
376 if (a_is_sparse)
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14844
diff changeset
377 symmetric = asmm.is_symmetric ();
12649
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
378 else
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14844
diff changeset
379 symmetric = amm.is_symmetric ();
12649
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
380 }
8579e7a6e6e0 Improve performance (2X) of svds by avoiding issymmetric calculation (bug #33073)
Rik <octave@nomad.inbox5.com>
parents: 12329
diff changeset
381
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
382 if (have_b)
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
383 {
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
384 if (a_is_complex || b_is_complex)
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
385 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
386 if (a_is_sparse)
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
387 bscm = args(b_arg).sparse_complex_matrix_value ();
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
388 else
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
389 bcm = args(b_arg).complex_matrix_value ();
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
390 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
391 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
392 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
393 if (a_is_sparse)
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
394 bsmm = args(b_arg).sparse_matrix_value ();
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
395 else
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
396 bmm = args(b_arg).matrix_value ();
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
397 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
398 }
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
399
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11553
diff changeset
400 // Mode 1 for SM mode seems unstable for some reason.
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
401 // Use Mode 3 instead, with sigma = 0.
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
402 if (! have_sigma && typ == "SM")
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
403 have_sigma = true;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
404
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
405 octave_idx_type nconv;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
406 if (a_is_complex || b_is_complex)
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
407 {
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
408 ComplexMatrix eig_vec;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
409 ComplexColumnVector eig_val;
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
410
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
411
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
412 if (have_a_fun)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
413 nconv = EigsComplexNonSymmetricFunc
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
414 (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
415 eig_val, cresid, octave_stdout, tol, (nargout > 1), cholB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
416 disp, maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
417 else if (have_sigma)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
418 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
419 if (a_is_sparse)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
420 nconv = EigsComplexNonSymmetricMatrixShift
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
421 (ascm, sigma, k, p, info, eig_vec, eig_val, bscm, permB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
422 cresid, octave_stdout, tol, (nargout > 1), cholB, disp,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
423 maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
424 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
425 nconv = EigsComplexNonSymmetricMatrixShift
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
426 (acm, sigma, k, p, info, eig_vec, eig_val, bcm, permB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
427 cresid, octave_stdout, tol, (nargout > 1), cholB, disp,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
428 maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
429 }
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
430 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
431 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
432 if (a_is_sparse)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
433 nconv = EigsComplexNonSymmetricMatrix
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
434 (ascm, typ, k, p, info, eig_vec, eig_val, bscm, permB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
435 cresid, octave_stdout, tol, (nargout > 1), cholB, disp,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
436 maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
437 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
438 nconv = EigsComplexNonSymmetricMatrix
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
439 (acm, typ, k, p, info, eig_vec, eig_val, bcm, permB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
440 cresid, octave_stdout, tol, (nargout > 1), cholB, disp,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
441 maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
442 }
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
443
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
444 if (nargout < 2)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
445 retval(0) = eig_val;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
446 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
447 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
448 retval(2) = double (info);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
449 retval(1) = ComplexDiagMatrix (eig_val);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
450 retval(0) = eig_vec;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
451 }
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
452 }
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
453 else if (sigmai != 0.)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
454 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
455 // Promote real problem to a complex one.
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
456 ComplexMatrix eig_vec;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
457 ComplexColumnVector eig_val;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
458
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
459 if (have_a_fun)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
460 nconv = EigsComplexNonSymmetricFunc
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
461 (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
462 eig_val, cresid, octave_stdout, tol, (nargout > 1), cholB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
463 disp, maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
464 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
465 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
466 if (a_is_sparse)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
467 nconv = EigsComplexNonSymmetricMatrixShift
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
468 (SparseComplexMatrix (asmm), sigma, k, p, info, eig_vec,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
469 eig_val, SparseComplexMatrix (bsmm), permB, cresid,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
470 octave_stdout, tol, (nargout > 1), cholB, disp, maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
471 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
472 nconv = EigsComplexNonSymmetricMatrixShift
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
473 (ComplexMatrix (amm), sigma, k, p, info, eig_vec,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
474 eig_val, ComplexMatrix (bmm), permB, cresid,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
475 octave_stdout, tol, (nargout > 1), cholB, disp, maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
476 }
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
477
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
478 if (nargout < 2)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
479 retval(0) = eig_val;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
480 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
481 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
482 retval(2) = double (info);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
483 retval(1) = ComplexDiagMatrix (eig_val);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
484 retval(0) = eig_vec;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
485 }
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
486 }
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
487 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
488 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
489 if (symmetric)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
490 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
491 Matrix eig_vec;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
492 ColumnVector eig_val;
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
493
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
494 if (have_a_fun)
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
495 nconv = EigsRealSymmetricFunc
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
496 (eigs_func, n, typ, sigmar, k, p, info, eig_vec,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
497 eig_val, resid, octave_stdout, tol, (nargout > 1),
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
498 cholB, disp, maxit);
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
499 else if (have_sigma)
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
500 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
501 if (a_is_sparse)
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
502 nconv = EigsRealSymmetricMatrixShift
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
503 (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
504 permB, resid, octave_stdout, tol, (nargout > 1),
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
505 cholB, disp, maxit);
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
506 else
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
507 nconv = EigsRealSymmetricMatrixShift
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
508 (amm, sigmar, k, p, info, eig_vec, eig_val, bmm,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
509 permB, resid, octave_stdout, tol, (nargout > 1),
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
510 cholB, disp, maxit);
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
511 }
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
512 else
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
513 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
514 if (a_is_sparse)
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
515 nconv = EigsRealSymmetricMatrix
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
516 (asmm, typ, k, p, info, eig_vec, eig_val, bsmm,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
517 permB, resid, octave_stdout, tol, (nargout > 1),
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
518 cholB, disp, maxit);
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
519 else
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
520 nconv = EigsRealSymmetricMatrix
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
521 (amm, typ, k, p, info, eig_vec, eig_val, bmm, permB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
522 resid, octave_stdout, tol, (nargout > 1), cholB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
523 disp, maxit);
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
524 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
525
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
526 if (nargout < 2)
14844
5bc9b9cb4362 maint: Use Octave coding conventions for cuddled parenthesis in retval assignments.
Rik <octave@nomad.inbox5.com>
parents: 14501
diff changeset
527 retval(0) = eig_val;
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
528 else
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
529 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
530 retval(2) = double (info);
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
531 retval(1) = DiagMatrix (eig_val);
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
532 retval(0) = eig_vec;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
533 }
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
534 }
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
535 else
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
536 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
537 ComplexMatrix eig_vec;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
538 ComplexColumnVector eig_val;
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
539
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
540 if (have_a_fun)
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
541 nconv = EigsRealNonSymmetricFunc
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
542 (eigs_func, n, typ, sigmar, k, p, info, eig_vec,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
543 eig_val, resid, octave_stdout, tol, (nargout > 1),
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
544 cholB, disp, maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
545 else if (have_sigma)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
546 {
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
547 if (a_is_sparse)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
548 nconv = EigsRealNonSymmetricMatrixShift
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
549 (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
550 permB, resid, octave_stdout, tol, (nargout > 1),
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
551 cholB, disp, maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
552 else
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
553 nconv = EigsRealNonSymmetricMatrixShift
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
554 (amm, sigmar, k, p, info, eig_vec, eig_val, bmm,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
555 permB, resid, octave_stdout, tol, (nargout > 1),
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
556 cholB, disp, maxit);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
557 }
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
558 else
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
559 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
560 if (a_is_sparse)
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
561 nconv = EigsRealNonSymmetricMatrix
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
562 (asmm, typ, k, p, info, eig_vec, eig_val, bsmm,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
563 permB, resid, octave_stdout, tol, (nargout > 1),
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
564 cholB, disp, maxit);
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
565 else
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
566 nconv = EigsRealNonSymmetricMatrix
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
567 (amm, typ, k, p, info, eig_vec, eig_val, bmm, permB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
568 resid, octave_stdout, tol, (nargout > 1), cholB,
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
569 disp, maxit);
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
570 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
571
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
572 if (nargout < 2)
14844
5bc9b9cb4362 maint: Use Octave coding conventions for cuddled parenthesis in retval assignments.
Rik <octave@nomad.inbox5.com>
parents: 14501
diff changeset
573 retval(0) = eig_val;
10154
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
574 else
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
575 {
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
576 retval(2) = double (info);
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
577 retval(1) = ComplexDiagMatrix (eig_val);
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
578 retval(0) = eig_vec;
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
579 }
40dfc0c99116 DLD-FUNCTIONS/*.cc: untabify
John W. Eaton <jwe@octave.org>
parents: 10066
diff changeset
580 }
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
581 }
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
582
20556
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
583 if (nconv <= 0)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
584 warning ("eigs: None of the %d requested eigenvalues converged", k);
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
585 else if (nconv < k)
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
586 warning ("eigs: Only %d of the %d requested eigenvalues converged",
4bed806ee3d4 eliminate more simple uses of error_state
John W. Eaton <jwe@octave.org>
parents: 19864
diff changeset
587 nconv, k);
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
588
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
589 if (! fcn_name.empty ())
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
590 clear_function (fcn_name);
14144
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
591 #else
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
592 error ("eigs: not available in this version of Octave");
834df9f10963 remove ARPACK files from sources and restore configure checks for external ARPACK library
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
593 #endif
8417
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
594
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
595 return retval;
654bcfb937bf Add the eigs and svds functions
David Bateman <dbateman@free.fr>
parents:
diff changeset
596 }