comparison liboctave/Array.cc @ 4567:fc30061d01da

[project @ 2003-10-29 20:11:15 by jwe]
author jwe
date Wed, 29 Oct 2003 20:11:16 +0000
parents c7eb767505e9
children c8c06e5ef5db
comparison
equal deleted inserted replaced
4566:30ba814d6700 4567:fc30061d01da
333 333
334 (*current_liboctave_error_handler) ("range error in Array"); 334 (*current_liboctave_error_handler) ("range error in Array");
335 335
336 static T foo; 336 static T foo;
337 return foo; 337 return foo;
338 }
339
340 template <class T>
341 Array<T>
342 Array<T>::reshape (const dim_vector& new_dims) const
343 {
344 Array<T> retval;
345
346 if (dimensions != new_dims)
347 {
348 if (dimensions.numel () == new_dims.numel ())
349 retval = Array<T> (*this, new_dims);
350 else
351 (*current_liboctave_error_handler) ("reshape: size mismatch");
352 }
353
354 return retval;
338 } 355 }
339 356
340 template <class T> 357 template <class T>
341 void 358 void
342 Array<T>::resize_no_fill (int n) 359 Array<T>::resize_no_fill (int n)