Mercurial > octave
changeset 23583:b7747a2c88b2
maint: Deprecate is_sparse_type and replace with issparse.
* ov.h (is_sparse_type): Use OCTAVE_DEPRECATED macro around function.
* ov.h (issparse): New function.
* __luinc__.cc, bsxfun.cc, cellfun.cc, data.cc, det.cc, find.cc, gcd.cc,
graphics.in.h, inv.cc, kron.cc, ls-mat4.cc, ls-mat5.cc, lu.cc, matrix_type.cc,
max.cc, mex.cc, rcond.cc, sparse.cc, tril.cc, variables.cc, xnorm.cc,
__eigs__.cc, __glpk__.cc, amd.cc, ccolamd.cc, chol.cc, colamd.cc, qr.cc,
ov-base-sparse.h, ov-base.h, ov-bool-mat.cc, pt-tm-const.cc:
Replace instances of is_sparse_type with issparse.
line wrap: on
line diff
--- a/libinterp/corefcn/__luinc__.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/__luinc__.cc Tue Jun 13 08:24:42 2017 -0700 @@ -53,7 +53,7 @@ if (nargin < 2 || nargin > 3) print_usage (); - if (! args(0).is_sparse_type ()) + if (! args(0).issparse ()) error ("luinc: matrix A must be sparse"); bool zero_level = false;
--- a/libinterp/corefcn/bsxfun.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/bsxfun.cc Tue Jun 13 08:24:42 2017 -0700 @@ -466,7 +466,7 @@ if (i == 0) { - if (! tmp(0).is_sparse_type ()) + if (! tmp(0).issparse ()) { std::string result_type = tmp(0).class_name (); if (result_type == "double")
--- a/libinterp/corefcn/cellfun.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/cellfun.cc Tue Jun 13 08:24:42 2017 -0700 @@ -2113,7 +2113,7 @@ d[i-1] = args(i).octave_idx_type_vector_value (true); octave_value a = args(0); - bool sparse = a.is_sparse_type (); + bool sparse = a.issparse (); if (sparse && nargin > 3) error ("mat2cell: sparse arguments only support 2-D indexing"); @@ -2268,7 +2268,7 @@ error ("cellslices: the lengths of LB and UB must match"); Cell retcell; - if (! x.is_sparse_type () && x.is_matrix_type ()) + if (! x.issparse () && x.is_matrix_type ()) { // specialize for some dense arrays. if (x.islogical ())
--- a/libinterp/corefcn/data.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/data.cc Tue Jun 13 08:24:42 2017 -0700 @@ -244,7 +244,7 @@ { if (args(0).is_scalar_type () && args(1).is_scalar_type ()) retval = atan2 (args(0).scalar_value (), args(1).scalar_value ()); - else if (args(0).is_sparse_type ()) + else if (args(0).issparse ()) { SparseMatrix m0 = args(0).sparse_matrix_value (); SparseMatrix m1 = args(1).sparse_matrix_value (); @@ -354,7 +354,7 @@ { if (arg0.is_scalar_type () && arg1.is_scalar_type ()) retval = hypot (arg0.scalar_value (), arg1.scalar_value ()); - else if (arg0.is_sparse_type () || arg1.is_sparse_type ()) + else if (arg0.issparse () || arg1.issparse ()) { SparseMatrix m0 = arg0.sparse_matrix_value (); SparseMatrix m1 = arg1.sparse_matrix_value (); @@ -666,7 +666,7 @@ { if (args(0).is_scalar_type () && args(1).is_scalar_type ()) retval = octave::math::rem (args(0).scalar_value (), args(1).scalar_value ()); - else if (args(0).is_sparse_type () || args(1).is_sparse_type ()) + else if (args(0).issparse () || args(1).issparse ()) { SparseMatrix m0 = args(0).sparse_matrix_value (); SparseMatrix m1 = args(1).sparse_matrix_value (); @@ -845,7 +845,7 @@ { if (args(0).is_scalar_type () && args(1).is_scalar_type ()) retval = octave::math::mod (args(0).scalar_value (), args(1).scalar_value ()); - else if (args(0).is_sparse_type () || args(1).is_sparse_type ()) + else if (args(0).issparse () || args(1).issparse ()) { SparseMatrix m0 = args(0).sparse_matrix_value (); SparseMatrix m1 = args(1).sparse_matrix_value (); @@ -928,7 +928,7 @@ \ if (arg.isreal ()) \ { \ - if (arg.is_sparse_type ()) \ + if (arg.issparse ()) \ { \ SparseMatrix tmp = arg.sparse_matrix_value (); \ \ @@ -949,7 +949,7 @@ } \ else if (arg.iscomplex ()) \ { \ - if (arg.is_sparse_type ()) \ + if (arg.issparse ()) \ { \ SparseComplexMatrix tmp = arg.sparse_complex_matrix_value (); \ \ @@ -1079,13 +1079,13 @@ switch (arg.builtin_type ()) { case btyp_double: - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = arg.sparse_matrix_value ().cumsum (dim); else retval = arg.array_value ().cumsum (dim); break; case btyp_complex: - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = arg.sparse_complex_matrix_value ().cumsum (dim); else retval = arg.complex_array_value ().cumsum (dim); @@ -1123,7 +1123,7 @@ #undef MAKE_INT_BRANCH case btyp_bool: - if (arg.is_sparse_type ()) + if (arg.issparse ()) { SparseMatrix cs = arg.sparse_matrix_value ().cumsum (dim); if (isnative) @@ -1365,13 +1365,13 @@ switch (arg.builtin_type ()) { case btyp_double: - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = arg.sparse_matrix_value ().prod (dim); else retval = arg.array_value ().prod (dim); break; case btyp_complex: - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = arg.sparse_complex_matrix_value ().prod (dim); else retval = arg.complex_array_value ().prod (dim); @@ -1414,7 +1414,7 @@ break; case btyp_bool: - if (arg.is_sparse_type ()) + if (arg.issparse ()) { if (isnative) retval = arg.sparse_bool_matrix_value ().all (dim); @@ -1803,7 +1803,7 @@ if (all_cmplx_p && ! (args(i).iscomplex () || args(i).isreal ())) all_cmplx_p = false; - if (! any_sparse_p && args(i).is_sparse_type ()) + if (! any_sparse_p && args(i).issparse ()) any_sparse_p = true; if (! any_cell_p && args(i).iscell ()) any_cell_p = true; @@ -2905,7 +2905,7 @@ switch (arg.builtin_type ()) { case btyp_double: - if (arg.is_sparse_type ()) + if (arg.issparse ()) { if (isextra) warning ("sum: 'extra' not yet implemented for sparse matrices"); @@ -2918,7 +2918,7 @@ break; case btyp_complex: - if (arg.is_sparse_type ()) + if (arg.issparse ()) { if (isextra) warning ("sum: 'extra' not yet implemented for sparse matrices"); @@ -2972,7 +2972,7 @@ break; case btyp_bool: - if (arg.is_sparse_type ()) + if (arg.issparse ()) { if (isnative) retval = arg.sparse_bool_matrix_value ().any (dim); @@ -3255,7 +3255,7 @@ retval = arg; else { - if (arg.is_sparse_type ()) + if (arg.issparse ()) { SparseComplexMatrix val = arg.xsparse_complex_matrix_value ("complex: invalid conversion"); @@ -3298,7 +3298,7 @@ octave_value re = args(0); octave_value im = args(1); - if (re.is_sparse_type () && im.is_sparse_type ()) + if (re.issparse () && im.issparse ()) { const SparseMatrix re_val = re.sparse_matrix_value (); const SparseMatrix im_val = im.sparse_matrix_value (); @@ -6689,7 +6689,7 @@ octave_value arg = args(0); - if (arg.is_sparse_type ()) + if (arg.issparse ()) error ("__sort_rows_idx__: sparse matrices not yet supported"); if (arg.ndims () != 2) @@ -6770,7 +6770,7 @@ if (by_rows) { - if (arg.is_sparse_type ()) + if (arg.issparse ()) error ("issorted: sparse matrices not yet supported"); if (arg.ndims () != 2) @@ -7504,7 +7504,7 @@ else panic_impossible (); } - else if (array.is_sparse_type ()) + else if (array.issparse ()) { if (array.iscomplex ()) retval = do_sparse_diff (array.sparse_complex_matrix_value (), @@ -7738,7 +7738,7 @@ if (! args(0).is_numeric_type ()) error ("base64_encode: encoding is supported only for numeric arrays"); - if (args(0).iscomplex () || args(0).is_sparse_type ()) + if (args(0).iscomplex () || args(0).issparse ()) error ("base64_encode: encoding complex or sparse data is not supported"); octave_value_list retval;
--- a/libinterp/corefcn/det.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/det.cc Tue Jun 13 08:24:42 2017 -0700 @@ -167,7 +167,7 @@ octave_idx_type info; double rcond = 0.0; // Always compute rcond, so we can detect singular matrices. - if (arg.is_sparse_type ()) + if (arg.issparse ()) { SparseMatrix m = arg.sparse_matrix_value (); @@ -194,7 +194,7 @@ octave_idx_type info; double rcond = 0.0; // Always compute rcond, so we can detect singular matrices. - if (arg.is_sparse_type ()) + if (arg.issparse ()) { SparseComplexMatrix m = arg.sparse_complex_matrix_value ();
--- a/libinterp/corefcn/find.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/find.cc Tue Jun 13 08:24:42 2017 -0700 @@ -427,7 +427,7 @@ if (arg.islogical ()) { - if (arg.is_sparse_type ()) + if (arg.issparse ()) { SparseBoolMatrix v = arg.sparse_bool_matrix_value (); @@ -472,7 +472,7 @@ else panic_impossible (); } - else if (arg.is_sparse_type ()) + else if (arg.issparse ()) { if (arg.isreal ()) {
--- a/libinterp/corefcn/gcd.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/gcd.cc Tue Jun 13 08:24:42 2017 -0700 @@ -267,7 +267,7 @@ switch (btyp) { case btyp_double: - if (a.is_sparse_type () && b.is_sparse_type ()) + if (a.issparse () && b.issparse ()) { retval = do_simple_gcd<SparseMatrix> (a, b); break; @@ -420,7 +420,7 @@ } // For consistency. - if (a.is_sparse_type () && b.is_sparse_type ()) + if (a.issparse () && b.issparse ()) { retval = retval.sparse_matrix_value (); x = x.sparse_matrix_value ();
--- a/libinterp/corefcn/graphics.in.h Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/graphics.in.h Tue Jun 13 08:24:42 2017 -0700 @@ -1368,7 +1368,7 @@ array_property (const std::string& nm, const graphics_handle& h, const octave_value& m) - : base_property (nm, h), data (m.is_sparse_type () ? m.full_value () : m), + : base_property (nm, h), data (m.issparse () ? m.full_value () : m), xmin (), xmax (), xminp (), xmaxp (), type_constraints (), size_constraints (), finite_constraint (NO_CHECK), minval (std::pair<double, bool> (octave_NaN, true)), @@ -1446,7 +1446,7 @@ protected: bool do_set (const octave_value& v) { - octave_value tmp = (v.is_sparse_type () ? v.full_value () : v); + octave_value tmp = (v.issparse () ? v.full_value () : v); if (! validate (tmp)) error ("invalid value for array property \"%s\"",
--- a/libinterp/corefcn/inv.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/inv.cc Tue Jun 13 08:24:42 2017 -0700 @@ -138,7 +138,7 @@ { if (arg.isreal ()) { - if (arg.is_sparse_type ()) + if (arg.issparse ()) { SparseMatrix m = arg.sparse_matrix_value (); @@ -157,7 +157,7 @@ } else if (arg.iscomplex ()) { - if (arg.is_sparse_type ()) + if (arg.issparse ()) { SparseComplexMatrix m = arg.sparse_complex_matrix_value ();
--- a/libinterp/corefcn/kron.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/kron.cc Tue Jun 13 08:24:42 2017 -0700 @@ -166,7 +166,7 @@ octave_value retval; if (a.is_perm_matrix () && b.is_perm_matrix ()) retval = do_kron<PermMatrix, PermMatrix> (a, b); - else if (a.is_sparse_type () || b.is_sparse_type ()) + else if (a.issparse () || b.issparse ()) { if (a.iscomplex () || b.iscomplex ()) retval = do_kron<SparseComplexMatrix, SparseComplexMatrix> (a, b);
--- a/libinterp/corefcn/ls-mat4.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/ls-mat4.cc Tue Jun 13 08:24:42 2017 -0700 @@ -394,7 +394,7 @@ { int32_t mopt = 0; - mopt += tc.is_sparse_type () ? 2 : tc.is_string () ? 1 : 0; + mopt += tc.issparse () ? 2 : tc.is_string () ? 1 : 0; octave::mach_info::float_format flt_fmt = octave::mach_info::native_float_format ();; @@ -408,7 +408,7 @@ int32_t nc = tc.columns (); - if (tc.is_sparse_type ()) + if (tc.issparse ()) { len = tc.nnz (); uint32_t nnz = len + 1; @@ -480,7 +480,7 @@ double tmp = tc.double_value (); os.write (reinterpret_cast<char *> (&tmp), 8); } - else if (tc.is_sparse_type ()) + else if (tc.issparse ()) { double ds; OCTAVE_LOCAL_BUFFER (double, dtmp, len);
--- a/libinterp/corefcn/ls-mat5.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/ls-mat5.cc Tue Jun 13 08:24:42 2017 -0700 @@ -2073,7 +2073,7 @@ if (chm.numel () > 2) ret += PAD (2 * chm.numel ()); } - else if (tc.is_sparse_type ()) + else if (tc.issparse ()) { if (tc.iscomplex ()) { @@ -2256,7 +2256,7 @@ } } - if (tc.is_sparse_type ()) + if (tc.issparse ()) { octave_idx_type nnz; octave_idx_type nc; @@ -2364,7 +2364,7 @@ flags |= MAT_FILE_UINT32_CLASS; else if (cname == "uint64") flags |= MAT_FILE_UINT64_CLASS; - else if (tc.is_sparse_type ()) + else if (tc.issparse ()) flags |= MAT_FILE_SPARSE_CLASS; else if (tc.is_real_scalar () || tc.is_real_matrix () || tc.is_range () || tc.is_complex_scalar () || tc.is_complex_matrix ()) @@ -2448,7 +2448,7 @@ os.write (padbuf, paddedlength - len); } } - else if (tc.is_sparse_type ()) + else if (tc.issparse ()) { if (tc.iscomplex ()) {
--- a/libinterp/corefcn/lu.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/lu.cc Tue Jun 13 08:24:42 2017 -0700 @@ -138,7 +138,7 @@ @end deftypefn */) { int nargin = args.length (); - bool issparse = (nargin > 0 && args(0).is_sparse_type ()); + bool issparse = (nargin > 0 && args(0).issparse ()); if (nargin < 1 || (issparse && nargin > 3) || (! issparse && nargin > 2)) print_usage ();
--- a/libinterp/corefcn/matrix_type.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/matrix_type.cc Tue Jun 13 08:24:42 2017 -0700 @@ -141,7 +141,7 @@ else retval = args(0); } - else if (args(0).is_sparse_type ()) + else if (args(0).issparse ()) { if (nargin == 1) {
--- a/libinterp/corefcn/max.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/max.cc Tue Jun 13 08:24:42 2017 -0700 @@ -115,7 +115,7 @@ { octave_value_list retval; - if (! arg.is_sparse_type ()) + if (! arg.issparse ()) { if (nargout <= 1) { @@ -288,7 +288,7 @@ (range.inc () >= 0 ? range.numel () : 1); } } - else if (arg.is_sparse_type ()) + else if (arg.issparse ()) retval = do_minmax_red_op<SparseMatrix> (arg, nargout, dim, ismin); else @@ -299,7 +299,7 @@ case btyp_complex: { - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = do_minmax_red_op<SparseComplexMatrix> (arg, nargout, dim, ismin); else @@ -364,9 +364,9 @@ { case btyp_double: { - if ((argx.is_sparse_type () - && (argy.is_sparse_type () || argy.is_scalar_type ())) - || (argy.is_sparse_type () && argx.is_scalar_type ())) + if ((argx.issparse () + && (argy.issparse () || argy.is_scalar_type ())) + || (argy.issparse () && argx.is_scalar_type ())) retval = do_minmax_bin_op<SparseMatrix> (argx, argy, ismin); else retval = do_minmax_bin_op<NDArray> (argx, argy, ismin); @@ -375,9 +375,9 @@ case btyp_complex: { - if ((argx.is_sparse_type () - && (argy.is_sparse_type () || argy.is_scalar_type ())) - || (argy.is_sparse_type () && argx.is_scalar_type ())) + if ((argx.issparse () + && (argy.issparse () || argy.is_scalar_type ())) + || (argy.issparse () && argx.is_scalar_type ())) retval = do_minmax_bin_op<SparseComplexMatrix> (argx, argy, ismin); else
--- a/libinterp/corefcn/mex.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/mex.cc Tue Jun 13 08:24:42 2017 -0700 @@ -238,7 +238,7 @@ int is_single (void) const { return val.is_single_type (); } - int is_sparse (void) const { return val.is_sparse_type (); } + int is_sparse (void) const { return val.issparse (); } int is_struct (void) const { return val.is_map (); } @@ -388,7 +388,7 @@ double get_scalar (void) const { - if (val.is_sparse_type ()) + if (val.issparse ()) { // For sparse arrays, return the first non-zero value. void *data = val.mex_get_data ();
--- a/libinterp/corefcn/rcond.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/rcond.cc Tue Jun 13 08:24:42 2017 -0700 @@ -50,7 +50,7 @@ octave_value retval; - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) error ("rcond: for sparse matrices use 'rcond (full (a))' or 'condest (a)' instead"); if (args(0).is_single_type ())
--- a/libinterp/corefcn/sparse.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/sparse.cc Tue Jun 13 08:24:42 2017 -0700 @@ -51,7 +51,7 @@ if (args.length () != 1) print_usage (); - return ovl (args(0).is_sparse_type ()); + return ovl (args(0).issparse ()); } DEFUN (sparse, args, ,
--- a/libinterp/corefcn/tril.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/tril.cc Tue Jun 13 08:24:42 2017 -0700 @@ -215,14 +215,14 @@ switch (arg.builtin_type ()) { case btyp_double: - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = do_trilu (arg.sparse_matrix_value (), k, lower, pack); else retval = do_trilu (arg.array_value (), k, lower, pack); break; case btyp_complex: - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = do_trilu (arg.sparse_complex_matrix_value (), k, lower, pack); else @@ -230,7 +230,7 @@ break; case btyp_bool: - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = do_trilu (arg.sparse_bool_matrix_value (), k, lower, pack); else
--- a/libinterp/corefcn/variables.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/variables.cc Tue Jun 13 08:24:42 2017 -0700 @@ -1364,7 +1364,7 @@ size_info(j) = val.size (); bytes_info(j) = val.byte_size (); class_info(j) = val.class_name (); - sparse_info(j) = val.is_sparse_type (); + sparse_info(j) = val.issparse (); complex_info(j) = val.iscomplex (); nesting_info(j) = ni; }
--- a/libinterp/corefcn/xnorm.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/corefcn/xnorm.cc Tue Jun 13 08:24:42 2017 -0700 @@ -38,7 +38,7 @@ bool isvector = (x.columns () == 1 || x.rows () == 1); bool iscomplex = x.iscomplex (); - bool issparse = x.is_sparse_type (); + bool issparse = x.issparse (); bool isfloat = x.is_single_type (); if (! isfloat && ! x.is_double_type ()) @@ -94,7 +94,7 @@ octave_value retval; bool iscomplex = x.iscomplex (); - bool issparse = x.is_sparse_type (); + bool issparse = x.issparse (); bool isfloat = x.is_single_type (); if (! isfloat && ! x.is_double_type ()) @@ -133,7 +133,7 @@ octave_value retval; bool iscomplex = x.iscomplex (); - bool issparse = x.is_sparse_type (); + bool issparse = x.issparse (); bool isfloat = x.is_single_type (); if (! isfloat && ! x.is_double_type ()) @@ -172,7 +172,7 @@ octave_value retval; bool iscomplex = x.iscomplex (); - bool issparse = x.is_sparse_type (); + bool issparse = x.issparse (); bool isfloat = x.is_single_type (); if (! isfloat && ! x.is_double_type ())
--- a/libinterp/dldfcn/__eigs__.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/dldfcn/__eigs__.cc Tue Jun 13 08:24:42 2017 -0700 @@ -232,7 +232,7 @@ { if (args(0).iscomplex ()) { - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) { ascm = (args(0).sparse_complex_matrix_value ()); a_is_sparse = true; @@ -245,7 +245,7 @@ } else { - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) { asmm = (args(0).sparse_matrix_value ()); a_is_sparse = true;
--- a/libinterp/dldfcn/__glpk__.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/dldfcn/__glpk__.cc Tue Jun 13 08:24:42 2017 -0700 @@ -358,7 +358,7 @@ // 2nd Input. A matrix containing the constraints coefficients. // If matrix A is NOT a sparse matrix - if (args(1).is_sparse_type ()) + if (args(1).issparse ()) { SparseMatrix A = args(1).xsparse_matrix_value ("__glpk__: invalid value of A");
--- a/libinterp/dldfcn/amd.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/dldfcn/amd.cc Tue Jun 13 08:24:42 2017 -0700 @@ -88,7 +88,7 @@ SparseMatrix sm; SparseComplexMatrix scm; - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) { if (args(0).iscomplex ()) {
--- a/libinterp/dldfcn/ccolamd.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/dldfcn/ccolamd.cc Tue Jun 13 08:24:42 2017 -0700 @@ -211,7 +211,7 @@ SparseComplexMatrix scm; SparseMatrix sm; - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) { if (args(0).iscomplex ()) { @@ -455,7 +455,7 @@ SparseMatrix sm; SparseComplexMatrix scm; - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) { if (args(0).iscomplex ()) {
--- a/libinterp/dldfcn/chol.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/dldfcn/chol.cc Tue Jun 13 08:24:42 2017 -0700 @@ -152,7 +152,7 @@ if (nargin < 1 || nargin > 3 || nargout > 3) print_usage (); - if (nargout > 2 && ! args(0).is_sparse_type ()) + if (nargout > 2 && ! args(0).issparse ()) error ("chol: using three output arguments, matrix A must be sparse"); bool LLt = false; @@ -179,7 +179,7 @@ if (arg.isempty ()) return ovl (Matrix ()); - if (arg.is_sparse_type ()) + if (arg.issparse ()) { octave_idx_type info; bool natural = (nargout != 3); @@ -374,7 +374,7 @@ retval = Matrix (); else { - if (arg.is_sparse_type ()) + if (arg.issparse ()) { octave_idx_type info; @@ -503,7 +503,7 @@ retval = Matrix (); else { - if (arg.is_sparse_type ()) + if (arg.issparse ()) { if (arg.isreal ()) {
--- a/libinterp/dldfcn/colamd.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/dldfcn/colamd.cc Tue Jun 13 08:24:42 2017 -0700 @@ -333,7 +333,7 @@ SparseComplexMatrix scm; SparseMatrix sm; - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) { if (args(0).iscomplex ()) { @@ -543,7 +543,7 @@ SparseMatrix sm; SparseComplexMatrix scm; - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) { if (args(0).iscomplex ()) { @@ -667,7 +667,7 @@ octave_idx_type *ridx = nullptr; octave_idx_type *cidx = nullptr; - if (args(0).is_sparse_type ()) + if (args(0).issparse ()) error ("etree: S must be a sparse matrix"); if (args(0).iscomplex ())
--- a/libinterp/dldfcn/qr.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/dldfcn/qr.cc Tue Jun 13 08:24:42 2017 -0700 @@ -268,7 +268,7 @@ is_cmplx = true; } - if (arg.is_sparse_type ()) + if (arg.issparse ()) { if (nargout > 2) error ("qr: Permutation output is not supported for sparse input");
--- a/libinterp/octave-value/ov-base-sparse.h Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/octave-value/ov-base-sparse.h Tue Jun 13 08:24:42 2017 -0700 @@ -142,7 +142,7 @@ bool is_numeric_type (void) const { return true; } - bool is_sparse_type (void) const { return true; } + bool issparse (void) const { return true; } bool is_defined (void) const { return true; }
--- a/libinterp/octave-value/ov-base.h Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/octave-value/ov-base.h Tue Jun 13 08:24:42 2017 -0700 @@ -425,7 +425,7 @@ virtual bool is_numeric_type (void) const { return false; } - virtual bool is_sparse_type (void) const { return false; } + virtual bool issparse (void) const { return false; } virtual bool is_true (void) const { return false; }
--- a/libinterp/octave-value/ov-bool-mat.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/octave-value/ov-bool-mat.cc Tue Jun 13 08:24:42 2017 -0700 @@ -604,7 +604,7 @@ retval = arg; else if (arg.is_numeric_type ()) { - if (arg.is_sparse_type ()) + if (arg.issparse ()) retval = arg.sparse_bool_matrix_value (); else if (arg.is_scalar_type ()) retval = arg.bool_value ();
--- a/libinterp/octave-value/ov.h Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/octave-value/ov.h Tue Jun 13 08:24:42 2017 -0700 @@ -697,8 +697,12 @@ bool is_numeric_type (void) const { return rep->is_numeric_type (); } + bool issparse (void) const + { return rep->issparse (); } + + OCTAVE_DEPRECATED ("use 'issparse' instead") bool is_sparse_type (void) const - { return rep->is_sparse_type (); } + { return rep->issparse (); } // Does this constant correspond to a truth value?
--- a/libinterp/parse-tree/pt-tm-const.cc Tue Jun 13 07:53:53 2017 -0700 +++ b/libinterp/parse-tree/pt-tm-const.cc Tue Jun 13 08:24:42 2017 -0700 @@ -108,14 +108,14 @@ if (! any_cell && val.iscell ()) any_cell = true; - if (! any_sparse && val.is_sparse_type ()) + if (! any_sparse && val.issparse ()) any_sparse = true; if (! any_class && val.is_object ()) any_class = true; // Special treatment of sparse matrices to avoid out-of-memory error - all_1x1 = all_1x1 && ! val.is_sparse_type () && val.numel () == 1; + all_1x1 = all_1x1 && ! val.issparse () && val.numel () == 1; } void