comparison liboctave/array/intNDArray.cc @ 20263:00cf2847355d

Deprecate Array::nelem() and Range::nelem() in favour of ::numel(). * liboctave/array/Array.h (Array::nelem) deprecate in favour of numel(). (Array::capacity, Array:: length): change to call numel() directly. These methods will be deprecated soon. * liboctave/array/PermMatrix.h (PermMatrix::nelem): deprecate in favour of numel(). * liboctave/array/Range.h (Range::numel) new method to replace nelem(). (Range::nelem) deprecate in favour of the new method numel. * liboctave/array/Sparse.h (Sparse::nelem) deprecate in favour of nzmax(). This one is secially bad because unlike the other classes, it is different from numel(). * libinterp/corefcn/debug.cc, libinterp/corefcn/jit-typeinfo.cc, libinterp/corefcn/ls-mat4.cc, libinterp/corefcn/lu.cc, libinterp/corefcn/luinc.cc, libinterp/corefcn/max.cc, libinterp/corefcn/pr-output.cc, libinterp/corefcn/rand.cc, libinterp/corefcn/xpow.cc, libinterp/dldfcn/__magick_read__.cc, libinterp/dldfcn/audioread.cc, libinterp/octave-value/ov-base-int.cc, libinterp/octave-value/ov-bool-mat.cc, libinterp/octave-value/ov-flt-re-mat.cc, libinterp/octave-value/ov-perm.cc, libinterp/octave-value/ov-range.cc, libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-mat.cc, libinterp/parse-tree/pt-eval.cc, liboctave/array/Array.cc, liboctave/array/CNDArray.cc, liboctave/array/Range.cc, liboctave/array/dNDArray.cc, liboctave/array/fCNDArray.cc, liboctave/array/fNDArray.cc, liboctave/array/idx-vector.cc, liboctave/array/intNDArray.cc, liboctave/numeric/SparseCmplxLU.cc, liboctave/numeric/SparsedbleLU.cc: replace use of nelem() with numel().
author Carnë Draug <carandraug@octave.org>
date Sun, 24 May 2015 02:41:37 +0100
parents 4197fc428c7d
children a9574e3c6e9e
comparison
equal deleted inserted replaced
20262:9f484edd8767 20263:00cf2847355d
47 47
48 template <class T> 48 template <class T>
49 bool 49 bool
50 intNDArray<T>::any_element_not_one_or_zero (void) const 50 intNDArray<T>::any_element_not_one_or_zero (void) const
51 { 51 {
52 octave_idx_type nel = this->nelem (); 52 octave_idx_type nel = this->numel ();
53 53
54 for (octave_idx_type i = 0; i < nel; i++) 54 for (octave_idx_type i = 0; i < nel; i++)
55 { 55 {
56 T val = this->elem (i); 56 T val = this->elem (i);
57 57
141 141
142 template <class T> 142 template <class T>
143 std::ostream& 143 std::ostream&
144 operator << (std::ostream& os, const intNDArray<T>& a) 144 operator << (std::ostream& os, const intNDArray<T>& a)
145 { 145 {
146 octave_idx_type nel = a.nelem (); 146 octave_idx_type nel = a.numel ();
147 147
148 for (octave_idx_type i = 0; i < nel; i++) 148 for (octave_idx_type i = 0; i < nel; i++)
149 os << " " << a.elem (i) << "\n"; 149 os << " " << a.elem (i) << "\n";
150 150
151 return os; 151 return os;
153 153
154 template <class T> 154 template <class T>
155 std::istream& 155 std::istream&
156 operator >> (std::istream& is, intNDArray<T>& a) 156 operator >> (std::istream& is, intNDArray<T>& a)
157 { 157 {
158 octave_idx_type nel = a.nelem (); 158 octave_idx_type nel = a.numel ();
159 159
160 if (nel > 0) 160 if (nel > 0)
161 { 161 {
162 T tmp; 162 T tmp;
163 163
181 181
182 template <class T> 182 template <class T>
183 intNDArray<T> 183 intNDArray<T>
184 intNDArray<T>::abs (void) const 184 intNDArray<T>::abs (void) const
185 { 185 {
186 octave_idx_type nel = this->nelem (); 186 octave_idx_type nel = this->numel ();
187 intNDArray<T> ret (this->dims ()); 187 intNDArray<T> ret (this->dims ());
188 188
189 for (octave_idx_type i = 0; i < nel; i++) 189 for (octave_idx_type i = 0; i < nel; i++)
190 { 190 {
191 T val = this->elem (i); 191 T val = this->elem (i);
197 197
198 template <class T> 198 template <class T>
199 intNDArray<T> 199 intNDArray<T>
200 intNDArray<T>::signum (void) const 200 intNDArray<T>::signum (void) const
201 { 201 {
202 octave_idx_type nel = this->nelem (); 202 octave_idx_type nel = this->numel ();
203 intNDArray<T> ret (this->dims ()); 203 intNDArray<T> ret (this->dims ());
204 204
205 for (octave_idx_type i = 0; i < nel; i++) 205 for (octave_idx_type i = 0; i < nel; i++)
206 { 206 {
207 T val = this->elem (i); 207 T val = this->elem (i);