comparison src/ops.h @ 9546:1beb23d2b892

optimize op= in common cases
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 19 Aug 2009 13:47:59 +0200
parents eb63fbe60fab
children e5f7aee2ab8c
comparison
equal deleted inserted replaced
9545:8670e55078fd 9546:1beb23d2b892
199 \ 199 \
200 v1.f (idx, v2.CONCAT2(e, _value) ()); \ 200 v1.f (idx, v2.CONCAT2(e, _value) ()); \
201 return octave_value (); \ 201 return octave_value (); \
202 } 202 }
203 203
204 // FIXME: the following currently doesn't handle index.
205 #define DEFNDASSIGNOP_OP(name, t1, t2, f, op) \
206 ASSIGNOPDECL (name) \
207 { \
208 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \
209 \
210 assert (idx.empty ()); \
211 v1.matrix_ref () op v2.CONCAT2(f, _value) (); \
212 \
213 return octave_value (); \
214 }
215
204 #define DEFASSIGNANYOP_FN(name, t1, f) \ 216 #define DEFASSIGNANYOP_FN(name, t1, f) \
205 ASSIGNANYOPDECL (name) \ 217 ASSIGNANYOPDECL (name) \
206 { \ 218 { \
207 CONCAT2(octave_, t1)& v1 = dynamic_cast<CONCAT2(octave_, t1)&> (a1); \ 219 CONCAT2(octave_, t1)& v1 = dynamic_cast<CONCAT2(octave_, t1)&> (a1); \
208 \ 220 \