help-octave
[Top][All Lists]
Advanced

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

Re: Need some help with Oct files


From: John W. Eaton
Subject: Re: Need some help with Oct files
Date: Tue, 5 Sep 2006 11:41:51 -0400

On  5-Sep-2006, Michael Creel wrote:

| That's interesting. Of course, samin.cc makes the declaration in the 
| part that is omitted - I pointed Philip to a specific file so he can 
| get a working example.

OK.  In any case, there is no need to write

  return octave_value_list(f_return);

if f_return is already an octave_value_list object since

  return f_return;

will work just as well and avoid an extra copy of the
octave_value_list object.

| But I hadn't thought of the ordering affecting 
| the number of resizings. Would the reverse order be expected to have a 
| noticeable effect on the time it takes the function to evaluate?

The time would probably not be significant for just a few values, but
why force the extra resizes if there is no need to?

| I'm 
| guessing that this would only be the case if the things in the list 
| used substantial memory or if it were called frequently. Is that correct?

No, because copying octave_value objects only copies a pointer and a
reference count, so the time required is independent of the size of
the object.

jwe


reply via email to

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