26#if defined (HAVE_CONFIG_H)
47DEFUN (issparse, args, ,
54 if (args.length () != 1)
57 return ovl (args(0).issparse ());
174 int nargin = args.length ();
176 if (nargin == 0 || nargin > 6)
188 "sparse: input array cast to double");
199 else if (nargin == 2)
201 octave_idx_type m = args(0).strict_idx_type_value (
"sparse: M must be a non-negative integer");
202 octave_idx_type n = args(1).strict_idx_type_value (
"sparse: N must be a non-negative integer");
205 error (
"sparse: dimensions M and N must be non-negative");
209 else if (nargin >= 3)
211 bool summation =
true;
212 if (nargin > 3 && args(nargin-1).is_string ())
214 std::string opt = args(nargin-1).string_value ();
217 else if (opt ==
"sum" || opt ==
"summation")
220 error (
"sparse: invalid option: %s", opt.c_str ());
229 nzmax = args(5).idx_type_value ();
235 m = args(3).strict_idx_type_value (
"sparse: M must be a non-negative integer");
236 n = args(4).strict_idx_type_value (
"sparse: N must be a non-negative integer");
239 error (
"sparse: dimensions M and N must be non-negative");
254 "sparse: input array cast to double");
257 i, j, m, n, summation, nzmax);
260 i, j, m, n, summation, nzmax);
264 i, j, m, n, summation, nzmax);
284DEFUN (spalloc, args, ,
325 int nargin = args.
length ();
327 if (nargin < 2 || nargin > 3)
335 nz = args(2).idx_type_value ();
337 if (m < 0 || n < 0 || nz < 0)
338 error (
"spalloc: M, N, and NZ must be non-negative");
363OCTAVE_END_NAMESPACE(octave)
Vector representing the dimensions (size) of an Array.
void set_pos_if_unset(octave_idx_type nd_arg, octave_idx_type dim_arg)
boolNDArray bool_array_value(bool warn=false) const
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
bool is_single_type() const
SparseBoolMatrix sparse_bool_matrix_value(bool warn=false) const
NDArray array_value(bool frc_str_conv=false) const
octave_idx_type length() const
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
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_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
void err_wrong_type_arg(const char *name, const char *s)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.