octave-maintainers
[Top][All Lists]
Advanced

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

Re: Really fix indexing in orderfields.m


From: Jason Riedy
Subject: Re: Really fix indexing in orderfields.m
Date: Wed, 28 Jan 2009 10:00:33 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

And Jaroslav Hajek writes:
> Okay, so please note this patch that replaces the loop by a proper
> index expression and also fixes the function to work with
> multdimensional structs (maybe you were not aware structs can have
> multiple dimensions?):

Thank you! I know about the multi-dims (I've written a few
partial matfile readers), but I was hung up on the field part.

> I see you were surprised that the assigment [t(:).x] = s(:).x doesn't
> work if t does not exist.

No, that was the obvious part. My disappointment was that t.("f1",
"f2") doesn't work to slice by fields like R's df$c("f1", "f2").
If it did, then t = s.(names) would be the easiest (and likely
fastest) method.

The surprise here is that t.("f1", "f2") returned *only* t.f1.
Right now, I can't spend the time on making this work, so chalk it
up to a future patch.

> This makes cells, structs and cs-lists interchangeable very cheaply if
> you avoid looping.  I hope this is going to contribute to performance
> of some complicated codes.

Thank you for all the indexing work! It very well might help for my
data analysis side.  Although now I seem to be hitting a memory
leak / gc issue. sigh. Have to work down to a test case to see if
it's my code's problem or not.

Jason


reply via email to

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