[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating double hypermatrix in C++
From: |
c. |
Subject: |
Re: Creating double hypermatrix in C++ |
Date: |
Wed, 19 Oct 2016 12:33:01 +0200 |
Hi,
Please use bottom posting :
https://en.wikipedia.org/wiki/Posting_style#Bottom-posting
or interleaved style :
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
We prefer that style on this list as it makes archived messages more readable.
On 19 Oct 2016, at 07:55, Shamika Mohanan <address@hidden> wrote:
> Suppose I want to create a 4 page hyper matrix with 2 rows and 3 columns, is
> the following correct?
>
> dim_vector d(2, 3, 4);
> NDArray ndarray_double(d,0.0);
>
> for( a= 0 ;a<4 ; a++)//Page
> {
> for( b= 0 ;b<2 ; b++)//Rows
> {
> for (c=0;c<3;c++) //Columns
> {
> ndarray_double (b,c,a) = some_value;
> }
> }
> }
>
> Shamika
this is correct but it may be slightly more efficient to reorganize
the loop so that it cycles through rows, columns, pages in that order.
c.