26 #if defined (HAVE_CONFIG_H)
40 DEFUN (spparms, args, nargout,
113 int nargin = args.
length ();
119 else if (nargout == 1)
121 else if (nargout == 2)
125 error (
"spparms: too many output arguments");
127 else if (nargin == 1)
129 if (args(0).is_string ())
131 std::string str = args(0).string_value ();
132 int len = str.length ();
133 for (
int i = 0; i <
len; i++)
134 str[i] = tolower (str[i]);
136 if (str ==
"default")
138 else if (str ==
"tight")
144 error (
"spparms: KEY not recognized");
151 NDArray vals = args(0).xarray_value (
"spparms: input must be a string or a vector");
153 error (
"spparms: too many elements in vector VALS");
158 else if (nargin == 2)
160 std::string str = args(0).xstring_value (
"spparms: first argument must be a string");
162 double val = args(1).xdouble_value (
"spparms: second argument must be a real scalar");
164 if (str ==
"umfpack")
165 warning (
"spparms: request to disable umfpack solvers ignored");
167 error (
"spparms: KEY not found");
170 error (
"spparms: too many input arguments");
205 OCTAVE_END_NAMESPACE(
octave)
octave_idx_type numel() const
Number of elements in the array.
octave_idx_type length() const
static double get_key(const std::string &key)
static void print_info(std::ostream &os, const std::string &prefix)
static bool set_key(const std::string &key, const double &val)
static bool set_vals(const Array< double > &vals)
static string_vector get_keys()
static ColumnVector get_vals()
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void warning(const char *fmt,...)
void() error(const char *fmt,...)
#define OCTAVE_SPARSE_CONTROLS_SIZE
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.