help-octave
[Top][All Lists]
Advanced

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

Cannot return an Array3


From: John W. Eaton
Subject: Cannot return an Array3
Date: Thu, 16 Jun 2005 10:56:56 -0400

On 16-Jun-2005, Søren Hauberg wrote:

| I was doing some work using octave 2.1.71 on linux in C++ where I tried 
| to return an Array3 to the octave prompt. This failed since there 
| doesn't appear to be an octave_value constructor for Array3. Is this a 
| bug or a feature? (It's not a big deal since I can just use ArrayN 
| instead, but I thought I'd better ask)
| 
| Here's my code:
| 
| #include <octave/oct.h>
| #include <octave/Array3.h>
| 
| DEFUN_DLD(test, args, nargout,"")
| {
|      Array3<double> a3(3,3,3);
|      return octave_value(a3);
| }

I'd say it's a feature.  You probably don't really need
Array3<double>.  It would just be converted to an NDArray object
internally, so that's the type I would recommend using.

Looking at it now, Array3 looks redundant and should probably go away.

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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