diff 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
line wrap: on
line diff
--- a/liboctave/Array.cc	Wed Oct 29 15:06:29 2003 +0000
+++ b/liboctave/Array.cc	Wed Oct 29 20:11:16 2003 +0000
@@ -338,6 +338,23 @@
 }
 
 template <class T>
+Array<T>
+Array<T>::reshape (const dim_vector& new_dims) const
+{
+  Array<T> retval;
+
+  if (dimensions != new_dims)
+    {
+      if (dimensions.numel () == new_dims.numel ())
+	retval = Array<T> (*this, new_dims);
+      else
+	(*current_liboctave_error_handler) ("reshape: size mismatch");
+    }
+
+  return retval;
+}
+
+template <class T>
 void
 Array<T>::resize_no_fill (int n)
 {