help-octave
[Top][All Lists]
Advanced

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

Re: size of NDArrays


From: Søren Hauberg
Subject: Re: size of NDArrays
Date: Mon, 11 Aug 2008 21:08:36 +0200

man, 11 08 2008 kl. 15:00 -0400, skrev Thomas L. Scofield:
> Can I safely assume that a dim_vector is simply an Array<octave_idx>,
> but that there are constructors for dim_vector only in the cases where
> lengths are 1, 2 or 3?

Looking at this page:
  http://octave.sourceforge.net/doxygen/html/classdim__vector.html
it seems that dim_vector is not an Array<octave_idx_type>. Is to the
constructors, I'm guessing that

  dim_vector (octave_idx_type n)

returns a dim_vector of length n, so you can do something like

  dim_vector dims (4);
  dims (0) = 5;
  dims (1) = 6;
  dims (2) = 7;
  dims (3) = 8;

to create a dim_vector with the values [5, 6, 7, 8].

  dim_vector (octave_idx_type r, octave_idx_type c)

however (I'm guessing again) returns a dim_vector with the values [r,
c]. The constructor with three arguments probably works like the one
with two arguments.

Søren



reply via email to

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