[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch for zeros() and ones()
From: |
John W. Eaton |
Subject: |
Re: Patch for zeros() and ones() |
Date: |
Wed, 6 Aug 2003 08:55:40 -0500 |
On 6-Aug-2003, Heine Kolltveit <address@hidden> wrote:
| On Wed, 30 Jul 2003, Heine Kolltveit wrote:
| > This patch extends zeros() and ones() to be able to create nd-arrays.
| > Thanks to Roderick Köehle for providing much of the code for this one.
|
| Here is the re-formatted patch.
Thanks for the patch. I think we are starting to make some progress.
I'm not sure what happened, but the patch for data.cc did not apply
cleanly. I also made a few changes to check error_state in a few more
places and also to create the octave_value object using
retval = ArrayN<double> (dims, val);
instead of
retval = new octave_double_nd_array (ArrayN<double> (dims, val));
so that the proper constructor for the octave_value object is called
(otherwise, it doesn't get the chance to perform the narrowing
operation).
You should probably update and take a look at what I did.
| 2003-08-06 Heine Kolltveit <address@hidden>
|
| *utils.h (check_dimensions(Array<int>&, char) and
| (get_dimensions(octave_value&, char, Array<int>&) and
| *utils.cc (check_dimensions(Array<int>&, char) and
| (get_dimensions(octave_value&, char, Array<int>&): new
| *data.cc (fill_matrix(...)): Added functionality to create nd-arrays
| (DEFUN(ones,...) and (DEFUN(zeros,...): Added the new syntax.
Please take a look at the way other ChangeLog entries are formatted
and follow the conventions already used.
Instead of DEFUN(ones,...), just write (Fones). This is a convention
used in Octave ChangeLogs (and copied from Emacs) when referring to
built-in functions declared with DEFUN (which actually defines a
function with the name prefixed with the character F).
Finally, can we agree to call these objects "N-d arrays"?
Thanks,
jwe