octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2.1.51 and reshape()


From: John W. Eaton
Subject: 2.1.51 and reshape()
Date: Sun, 16 Nov 2003 20:06:52 -0600

On 16-Nov-2003, Paul Soderlind <address@hidden> wrote:

| 2.1.51 on cygwin returns an error message on reshape(1:9,3,3) - although
| ((1:9)',3,3) works fine.

Please try the following patch.

Thanks,

jwe


src/ChangeLog:

2003-11-16  John W. Eaton  <address@hidden>

        * ov-range.h (octave_range::reshape): New function.


Index: src/ov-range.h
===================================================================
RCS file: /usr/local/cvsroot/octave/src/ov-range.h,v
retrieving revision 1.34
diff -u -r1.34 ov-range.h
--- src/ov-range.h      14 Nov 2003 19:49:56 -0000      1.34
+++ src/ov-range.h      17 Nov 2003 02:05:30 -0000
@@ -109,6 +109,9 @@
       return dim_vector (n > 0, n);
     }
 
+  octave_value reshape (const dim_vector& new_dims) const
+    { return NDArray (matrix_value().reshape (new_dims)); }
+
   bool is_defined (void) const { return true; }
 
   bool is_constant (void) const { return true; }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]