octave-maintainers
[Top][All Lists]
Advanced

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

Re: [Solved differently] Re: Hpw to assign a struct to a cell array elem


From: Philip Nienhuis
Subject: Re: [Solved differently] Re: Hpw to assign a struct to a cell array element in an .oct file
Date: Sun, 20 Dec 2015 13:25:12 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38

Kozma, Endre wrote:
On Sat, 2015-12-19 at 21:37 +0100, Philip Nienhuis wrote:


So now I have the following code:

:
static const char *fields[] = {"bbox", "data", "min", "max", "ndv"};
octave_map m_band (dim_vector (band_count, 1), string_vector (fields));
    /// line wrap
octave_idx_type curr_band;
octave_scalar_map band_struct = (string_vector (fields));
:
for (octave_idx_type curr_band = 0; curr_band < band_count; curr_band++)
   {
    :
    < fill up band_struct with raster data>
    :
    m_band.fast_elem_insert (curr_band, band_struct);
}

Great! Of course octave_idx_type cannot help. I guess, it's only int or
long int  depending upon the architecture.

I suppose that a.o., octave_idx_type will help making 64-bit indexing work (it does here).

On the other hand, look out, you have defined two curr_band variables.
The first one may be superfluous.

Yep I've already cleaned up the code yesterday.

Next challenge: make drawing those grids work a bit faster (surf & friends are awfully slow).

Thanks,

Philip





reply via email to

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