36 DEFUN (spparms, args, nargout,
38 @deftypefn {Built-in Function} { } spparms ()\n\
39 @deftypefnx {Built-in Function} {@var{vals} =} spparms ()\n\
40 @deftypefnx {Built-in Function} {[@var{keys}, @var{vals}] =} spparms ()\n\
41 @deftypefnx {Built-in Function} {@var{val} =} spparms (@var{key})\n\
42 @deftypefnx {Built-in Function} { } spparms (@var{vals})\n\
43 @deftypefnx {Built-in Function} { } spparms (\"defaults\")\n\
44 @deftypefnx {Built-in Function} { } spparms (\"tight\")\n\
45 @deftypefnx {Built-in Function} { } spparms (@var{key}, @var{val})\n\
46 Query or set the parameters used by the sparse solvers and factorization\n\
47 functions. The first four calls above get information about the current\n\
48 settings, while the others change the current settings. The parameters are\n\
49 stored as pairs of keys and values, where the values are all floats and the\n\
50 keys are one of the following strings:\n\
54 Printing level of debugging information of the solvers (default 0)\n\
57 Included for compatibility. Not used. (default 1)\n\
60 Included for compatibility. Not used. (default 1)\n\
63 Included for compatibility. Not used. (default 0)\n\
66 Included for compatibility. Not used. (default 3)\n\
69 Included for compatibility. Not used. (default 3)\n\
72 Included for compatibility. Not used. (default 0.5)\n\
75 Flag whether the LU/QR and the '\\' and '/' operators will automatically\n\
76 use the sparsity preserving mmd functions (default 1)\n\
79 Flag whether the LU and the '\\' and '/' operators will automatically\n\
80 use the sparsity preserving amd functions (default 1)\n\
83 The pivot tolerance of the @sc{umfpack} solvers (default 0.1)\n\
86 The pivot tolerance of the @sc{umfpack} symmetric solvers (default 0.001)\n\
89 The density of non-zero elements in a banded matrix before it is treated\n\
90 by the @sc{lapack} banded solvers (default 0.5)\n\
93 Flag whether the @sc{umfpack} or mmd solvers are used for the LU, '\\' and\n\
94 '/' operations (default 1)\n\
97 The value of individual keys can be set with\n\
98 @code{spparms (@var{key}, @var{val})}.\n\
99 The default values can be restored with the special keyword\n\
100 @qcode{\"defaults\"}. The special keyword @qcode{\"tight\"} can be used to\n\
101 set the mmd solvers to attempt a sparser solution at the potential cost of\n\
102 longer running time.\n\
106 int nargin = args.
length ();
112 else if (nargout == 1)
114 else if (nargout == 2)
120 error (
"spparms: too many output arguments");
122 else if (nargin == 1)
126 std::string str = args(0).string_value ();
127 int len = str.length ();
128 for (
int i = 0; i < len; i++)
129 str[i] = tolower (str[i]);
131 if (str ==
"defaults")
133 else if (str ==
"tight")
139 error (
"spparms: KEY not recognized");
146 NDArray vals = args(0).array_value ();
149 error (
"spparms: input must be a string or a vector");
151 error (
"spparms: too many elements in vector VALS");
156 else if (nargin == 2)
160 std::string str = args(0).string_value ();
162 double val = args(1).double_value ();
165 error (
"spparms: second argument must be a real scalar");
166 else if (str ==
"umfpack")
167 warning (
"spparms: request to disable umfpack solvers ignored");
169 error (
"spparms: KEY not found");
172 error (
"spparms: first argument must be a string");
175 error (
"spparms: too many input arguments");