comparison libinterp/operators/op-b-sbm.cc @ 28630:35f974bab4c8

fix constness of cat op args Declare the first argument of the cat_op concatenation operators const. * ov-typeinfo.h (cat_op_fcn): Make first argument of concatenation operator typedef const. * op-b-sbm.cc, op-bm-sbm.cc, op-chm.cc, op-cm-scm.cc, op-cm-sm.cc, op-cs-scm.cc, op-cs-sm.cc, op-m-scm.cc, op-m-sm.cc, op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-struct.cc: Fix concatentation operator declarations and casts as needed. * ops.h (DEFCATOPX, DEFCATOP, DEFCATOP_FN, DEFNDCATOP_FN, DEFNDCHARCATOP_FN, DEFNDCATOP_FN2): Likewise.
author John W. Eaton <jwe@octave.org>
date Thu, 30 Jul 2020 16:15:03 -0400
parents bd51beb6205e
children 7854d5752dd2
comparison
equal deleted inserted replaced
28629:af361aea02e0 28630:35f974bab4c8
47 DEFBINOP_FN (el_and, bool, sparse_bool_matrix, mx_el_and) 47 DEFBINOP_FN (el_and, bool, sparse_bool_matrix, mx_el_and)
48 DEFBINOP_FN (el_or, bool, sparse_bool_matrix, mx_el_or) 48 DEFBINOP_FN (el_or, bool, sparse_bool_matrix, mx_el_or)
49 49
50 DEFCATOP (b_sbm, bool, sparse_bool_matrix) 50 DEFCATOP (b_sbm, bool, sparse_bool_matrix)
51 { 51 {
52 octave_bool& v1 = dynamic_cast<octave_bool&> (a1); 52 const octave_bool& v1 = dynamic_cast<const octave_bool&> (a1);
53 const octave_sparse_bool_matrix& v2 53 const octave_sparse_bool_matrix& v2
54 = dynamic_cast<const octave_sparse_bool_matrix&> (a2); 54 = dynamic_cast<const octave_sparse_bool_matrix&> (a2);
55 SparseBoolMatrix tmp (1, 1, v1.bool_value ()); 55 SparseBoolMatrix tmp (1, 1, v1.bool_value ());
56 return octave_value (tmp. concat (v2.sparse_bool_matrix_value (), 56 return octave_value (tmp. concat (v2.sparse_bool_matrix_value (),
57 ra_idx)); 57 ra_idx));
58 } 58 }
59 59
60 DEFCATOP (b_sm, bool, sparse_matrix) 60 DEFCATOP (b_sm, bool, sparse_matrix)
61 { 61 {
62 octave_bool& v1 = dynamic_cast<octave_bool&> (a1); 62 const octave_bool& v1 = dynamic_cast<const octave_bool&> (a1);
63 const octave_sparse_matrix& v2 = dynamic_cast<const octave_sparse_matrix&> (a2); 63 const octave_sparse_matrix& v2 = dynamic_cast<const octave_sparse_matrix&> (a2);
64 SparseMatrix tmp (1, 1, v1.scalar_value ()); 64 SparseMatrix tmp (1, 1, v1.scalar_value ());
65 return octave_value (tmp. concat (v2.sparse_matrix_value (), ra_idx)); 65 return octave_value (tmp. concat (v2.sparse_matrix_value (), ra_idx));
66 } 66 }
67 67
68 DEFCATOP (s_sbm, scalar, sparse_bool_matrix) 68 DEFCATOP (s_sbm, scalar, sparse_bool_matrix)
69 { 69 {
70 octave_scalar& v1 = dynamic_cast<octave_scalar&> (a1); 70 const octave_scalar& v1 = dynamic_cast<const octave_scalar&> (a1);
71 const octave_sparse_bool_matrix& v2 71 const octave_sparse_bool_matrix& v2
72 = dynamic_cast<const octave_sparse_bool_matrix&> (a2); 72 = dynamic_cast<const octave_sparse_bool_matrix&> (a2);
73 SparseMatrix tmp (1, 1, v1.scalar_value ()); 73 SparseMatrix tmp (1, 1, v1.scalar_value ());
74 return octave_value(tmp. concat (v2.sparse_matrix_value (), ra_idx)); 74 return octave_value(tmp. concat (v2.sparse_matrix_value (), ra_idx));
75 } 75 }