help-octave
[Top][All Lists]
Advanced

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

Allocating N-dimensional Array in C++


From: Søren Hauberg
Subject: Allocating N-dimensional Array in C++
Date: Sat, 06 Mar 2010 10:53:57 -0800

Hi All

I can't seem to figure out how to use 'dim_vector' in C++ (using the
development sources). Say, I want to create a 4 dimensional array of
size 1x7x3x2, then I would have thought I should do something like

    dim_vector size (4, 1);
    size (0) = 1;
    size (1) = 7;
    size (2) = 3;
    size (3) = 2;
    
    NDArray A (size);

This, however, seems to create a 1x7 array. So, what is the right way of
accomplishing this? Also, should I be using 'NDArray' or 'Array<double>'
these days?

Thanks,
Søren



reply via email to

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