help-octave
[Top][All Lists]
Advanced

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

Re: Array vs. ArrayN in 3.2.x and development sources?


From: Carlo de Falco
Subject: Re: Array vs. ArrayN in 3.2.x and development sources?
Date: Mon, 22 Mar 2010 21:30:30 +0100


On 22 Mar 2010, at 21:20, Søren Hauberg wrote:

Hi All

As the maintainer of the 'image' package I would like to have the
package working with both the stable version of Octave (3.2.x) and the
development version (which I use myself). In some C++ code I'm having
problems with achieving this goal.

Basically, I need an N-dimensional array of 'double's and I need to
return this to the user. One approach is to do

 ArrayN<double> b (dim_vector (h, w, 2));
 return octave_value (b);

This requires that I include "octave/ArrayN.h" in the development
version and it gives me a warning (and I don't like warnings). Another
solution is to do

 Array<double> b (dim_vector (h, w, 2));
 return octave_value (b);

(just replace "ArrayN" by "Array") but this doesn't work in the stable
version as there is no 'octave_value' constructor for 'Array<double>'.
This is, however, the recommended way of doing things in the development
version.

So, does anybody have an approach that works in both versions and
doesn't give me any warnings?

Thanks
Søren

does

NDArray b (dim_vector (h, w, 2));
return octave_value (b);

work?

c.


reply via email to

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