Mercurial > octave-nkf
comparison src/DLD-FUNCTIONS/sparse.cc @ 5631:7171d19706df
[project @ 2006-02-22 20:15:06 by dbateman]
author | dbateman |
---|---|
date | Wed, 22 Feb 2006 20:16:00 +0000 |
parents | 2857357f9d3c |
children | 2618a0750ae6 |
comparison
equal
deleted
inserted
replaced
5630:512d0d11ae39 | 5631:7171d19706df |
---|---|
39 #include "ov-bool-sparse.h" | 39 #include "ov-bool-sparse.h" |
40 | 40 |
41 static bool | 41 static bool |
42 is_sparse (const octave_value& arg) | 42 is_sparse (const octave_value& arg) |
43 { | 43 { |
44 return (arg.class_name () == "sparse"); | 44 return (arg.is_sparse_type ()); |
45 } | 45 } |
46 | 46 |
47 DEFUN_DLD (issparse, args, , | 47 DEFUN_DLD (issparse, args, , |
48 "-*- texinfo -*-\n\ | 48 "-*- texinfo -*-\n\ |
49 @deftypefn {Loadable Function} {} issparse (@var{expr})\n\ | 49 @deftypefn {Loadable Function} {} issparse (@var{expr})\n\ |
383 if (args.length() < 1) { | 383 if (args.length() < 1) { |
384 print_usage ("full"); | 384 print_usage ("full"); |
385 return retval; | 385 return retval; |
386 } | 386 } |
387 | 387 |
388 if (args(0).class_name () == "sparse") | 388 if (args(0).is_sparse_type ()) |
389 { | 389 { |
390 if (args(0).type_name () == "sparse matrix") | 390 if (args(0).type_name () == "sparse matrix") |
391 retval = args(0).matrix_value (); | 391 retval = args(0).matrix_value (); |
392 else if (args(0).type_name () == "sparse complex matrix") | 392 else if (args(0).type_name () == "sparse complex matrix") |
393 retval = args(0).complex_matrix_value (); | 393 retval = args(0).complex_matrix_value (); |
561 } | 561 } |
562 | 562 |
563 | 563 |
564 octave_value arg = args(0); | 564 octave_value arg = args(0); |
565 | 565 |
566 if (arg.class_name () == "sparse") | 566 if (arg.is_sparse_type ()) |
567 { | 567 { |
568 if (arg.type_name () == "sparse matrix") | 568 if (arg.type_name () == "sparse matrix") |
569 retval = sparse_find (args(0).sparse_matrix_value ()); | 569 retval = sparse_find (args(0).sparse_matrix_value ()); |
570 else if (arg.type_name () == "sparse complex matrix" ) | 570 else if (arg.type_name () == "sparse complex matrix" ) |
571 retval = sparse_find (args(0).sparse_complex_matrix_value ()); | 571 retval = sparse_find (args(0).sparse_complex_matrix_value ()); |