26 #if defined (HAVE_CONFIG_H)
38 DEFUN (spparms, args, nargout,
111 int nargin = args.length ();
117 else if (nargout == 1)
119 else if (nargout == 2)
123 error (
"spparms: too many output arguments");
125 else if (nargin == 1)
127 if (args(0).is_string ())
129 std::string str = args(0).string_value ();
130 int len = str.length ();
131 for (
int i = 0; i <
len; i++)
132 str[i] = tolower (str[i]);
134 if (str ==
"default")
136 else if (str ==
"tight")
142 error (
"spparms: KEY not recognized");
149 NDArray vals = args(0).xarray_value (
"spparms: input must be a string or a vector");
151 error (
"spparms: too many elements in vector VALS");
156 else if (nargin == 2)
158 std::string str = args(0).xstring_value (
"spparms: first argument must be a string");
160 double val = args(1).xdouble_value (
"spparms: second argument must be a real scalar");
162 if (str ==
"umfpack")
163 warning (
"spparms: request to disable umfpack solvers ignored");
165 error (
"spparms: KEY not found");
168 error (
"spparms: too many input arguments");
octave_idx_type numel(void) const
Number of elements in the array.
static string_vector get_keys(void)
static void print_info(std::ostream &os, const std::string &prefix)
static ColumnVector get_vals(void)
static bool set_key(const std::string &key, const double &val)
static double get_key(const std::string &key)
static bool set_vals(const NDArray &vals)
static void defaults(void)
#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::octave_value(const Array< char > &chm, char type) return retval
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.