help-octave
[Top][All Lists]
Advanced

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

Re: Array Initialisation


From: Jaroslav Hajek
Subject: Re: Array Initialisation
Date: Fri, 30 Apr 2010 14:10:03 +0200

On Thu, Apr 29, 2010 at 10:53 AM, Paul Keir <address@hidden> wrote:
> Hi,
>
>
>
> When using the Octave C++ libs, is it possible to initialise an array with a
> POD array which is already allocated?
>
>
>
> Perhaps something like:
>
>
>
> double data[W*H];
>
> Array2<double> a(data,W,H);
>
>
>
> Or maybe:
>
>
>
> Array2<double> b(W,H);
>
> b.set(data,W*H);
>
>
>
> I guess that might interfere with the reference counting in ArrayRep?
>
>
>
> Many thanks,
>
> Paul
>

If what you mean is to avoid a copy, then no; this is not possible;
yes, the reason is memory management. Copying a raw data to an array
can be done through fortran_vec.



-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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