Mercurial > octave-nkf
comparison liboctave/MArrayN.cc @ 9607:1be3c73ed7b5
reuse temporary arrays in nested expressions
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 03 Sep 2009 08:48:51 +0200 |
parents | 3a1dd361f978 |
children | 66970dd627f6 |
comparison
equal
deleted
inserted
replaced
9606:a04352386a6b | 9607:1be3c73ed7b5 |
---|---|
27 #include "MArrayN.h" | 27 #include "MArrayN.h" |
28 #include "Array-util.h" | 28 #include "Array-util.h" |
29 #include "lo-error.h" | 29 #include "lo-error.h" |
30 | 30 |
31 #include "MArray-defs.h" | 31 #include "MArray-defs.h" |
32 #include "mx-inlines.cc" | |
32 | 33 |
33 // N-dimensional array with math ops. | 34 // N-dimensional array with math ops. |
35 template <class T> | |
36 void | |
37 MArrayN<T>::changesign (void) | |
38 { | |
39 if (Array<T>::is_shared ()) | |
40 *this = - *this; | |
41 else | |
42 do_mx_inplace_op<MArrayN<T> > (*this, mx_inline_uminus2); | |
43 } | |
34 | 44 |
35 // Element by element MArrayN by scalar ops. | 45 // Element by element MArrayN by scalar ops. |
36 | 46 |
37 template <class T> | 47 template <class T> |
38 MArrayN<T>& | 48 MArrayN<T>& |