Mercurial > octave
comparison libinterp/operators/op-sbm-b.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 |
---|---|
54 DEFBINOP_FN (el_and, sparse_bool_matrix, bool, mx_el_and) | 54 DEFBINOP_FN (el_and, sparse_bool_matrix, bool, mx_el_and) |
55 DEFBINOP_FN (el_or, sparse_bool_matrix, bool, mx_el_or) | 55 DEFBINOP_FN (el_or, sparse_bool_matrix, bool, mx_el_or) |
56 | 56 |
57 DEFCATOP (sbm_b, sparse_bool_matrix, bool) | 57 DEFCATOP (sbm_b, sparse_bool_matrix, bool) |
58 { | 58 { |
59 octave_sparse_bool_matrix& v1 = dynamic_cast<octave_sparse_bool_matrix&> (a1); | 59 const octave_sparse_bool_matrix& v1 = dynamic_cast<const octave_sparse_bool_matrix&> (a1); |
60 const octave_bool& v2 = dynamic_cast<const octave_bool&> (a2); | 60 const octave_bool& v2 = dynamic_cast<const octave_bool&> (a2); |
61 | 61 |
62 SparseBoolMatrix tmp (1, 1, v2.bool_value ()); | 62 SparseBoolMatrix tmp (1, 1, v2.bool_value ()); |
63 return octave_value (v1.sparse_bool_matrix_value (). concat (tmp, ra_idx)); | 63 return octave_value (v1.sparse_bool_matrix_value (). concat (tmp, ra_idx)); |
64 } | 64 } |
65 | 65 |
66 DEFCATOP (sm_b, sparse_matrix, bool) | 66 DEFCATOP (sm_b, sparse_matrix, bool) |
67 { | 67 { |
68 octave_sparse_matrix& v1 = dynamic_cast<octave_sparse_matrix&> (a1); | 68 const octave_sparse_matrix& v1 = dynamic_cast<const octave_sparse_matrix&> (a1); |
69 const octave_bool& v2 = dynamic_cast<const octave_bool&> (a2); | 69 const octave_bool& v2 = dynamic_cast<const octave_bool&> (a2); |
70 | 70 |
71 SparseMatrix tmp (1, 1, v2.scalar_value ()); | 71 SparseMatrix tmp (1, 1, v2.scalar_value ()); |
72 return octave_value (v1.sparse_matrix_value (). concat (tmp, ra_idx)); | 72 return octave_value (v1.sparse_matrix_value (). concat (tmp, ra_idx)); |
73 } | 73 } |
74 | 74 |
75 DEFCATOP (sbm_s, sparse_bool_matrix, scalar) | 75 DEFCATOP (sbm_s, sparse_bool_matrix, scalar) |
76 { | 76 { |
77 octave_sparse_bool_matrix& v1 = dynamic_cast<octave_sparse_bool_matrix&> (a1); | 77 const octave_sparse_bool_matrix& v1 = dynamic_cast<const octave_sparse_bool_matrix&> (a1); |
78 const octave_scalar& v2 = dynamic_cast<const octave_scalar&> (a2); | 78 const octave_scalar& v2 = dynamic_cast<const octave_scalar&> (a2); |
79 | 79 |
80 SparseMatrix tmp (1, 1, v2.scalar_value ()); | 80 SparseMatrix tmp (1, 1, v2.scalar_value ()); |
81 return octave_value (v1.sparse_matrix_value (). concat (tmp, ra_idx)); | 81 return octave_value (v1.sparse_matrix_value (). concat (tmp, ra_idx)); |
82 } | 82 } |