help-octave
[Top][All Lists]
Advanced

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

Re: Allocating N-dimensional Array in C++


From: Søren Hauberg
Subject: Re: Allocating N-dimensional Array in C++
Date: Sat, 06 Mar 2010 11:30:26 -0800

lør, 06 03 2010 kl. 20:11 +0100, skrev Carlo de Falco:
> > dim_vector size; idxa.resize (4);
> >   size (0) = 1;
> >   size (1) = 7;
> >   size (2) = 3;
> >   size (3) = 2;
> >
> >   NDArray A (size);
> 
> ooops, of course that was
> dim_vector size; size.resize (4);

Ahh, that works for me. Thanks a bunch!

Could be potentially add an API for creating 'dim_vector's for high
dimensional arrays, like

  const octave_idx_type tmp_size [] = {1, 7, 3, 2};
  const dim_vector size (tmp_size, sizeof (tmp_size));

?

Søren



reply via email to

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