comparison src/ov-bool-sparse.cc @ 5759:ce79d238f142

[project @ 2006-04-13 13:04:32 by jwe]
author jwe
date Thu, 13 Apr 2006 13:04:33 +0000
parents 2857357f9d3c
children 8d7162924bd3
comparison
equal deleted inserted replaced
5758:65208d959bf1 5759:ce79d238f142
47 47
48 DEFINE_OCTAVE_ALLOCATOR (octave_sparse_bool_matrix); 48 DEFINE_OCTAVE_ALLOCATOR (octave_sparse_bool_matrix);
49 49
50 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_sparse_bool_matrix, "sparse bool matrix", "sparse"); 50 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_sparse_bool_matrix, "sparse bool matrix", "sparse");
51 51
52 static octave_value * 52 static octave_base_value *
53 default_numeric_conversion_function (const octave_value& a) 53 default_numeric_conversion_function (const octave_base_value& a)
54 { 54 {
55 CAST_CONV_ARG (const octave_sparse_bool_matrix&); 55 CAST_CONV_ARG (const octave_sparse_bool_matrix&);
56 56
57 return new octave_sparse_matrix (SparseMatrix (v.sparse_bool_matrix_value ())); 57 return new octave_sparse_matrix (SparseMatrix (v.sparse_bool_matrix_value ()));
58 } 58 }
59 59
60 type_conv_fcn 60 octave_base_value::type_conv_fcn
61 octave_sparse_bool_matrix::numeric_conversion_function (void) const 61 octave_sparse_bool_matrix::numeric_conversion_function (void) const
62 { 62 {
63 return default_numeric_conversion_function; 63 return default_numeric_conversion_function;
64 } 64 }
65 65
66 octave_value * 66 octave_base_value *
67 octave_sparse_bool_matrix::try_narrowing_conversion (void) 67 octave_sparse_bool_matrix::try_narrowing_conversion (void)
68 { 68 {
69 octave_value *retval = 0; 69 octave_base_value *retval = 0;
70 70
71 // Don't use numel, since it can overflow for very large matrices 71 // Don't use numel, since it can overflow for very large matrices
72 // Note that for the second test, this means it becomes approximative 72 // Note that for the second test, this means it becomes approximative
73 // since it involves a cast to double to avoid issues of overflow 73 // since it involves a cast to double to avoid issues of overflow
74 if (matrix.rows () == 1 && matrix.cols () == 1) 74 if (matrix.rows () == 1 && matrix.cols () == 1)