octave-maintainers
[Top][All Lists]
Advanced

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

Re: Five other functions that are in Matlab core ported to Octave


From: John W. Eaton
Subject: Re: Five other functions that are in Matlab core ported to Octave
Date: Mon, 10 Sep 2007 16:47:35 -0400

On  6-Sep-2007, David Bateman wrote:

| Another thing I noticed is that in ::assign there is the code
| 
|   return (lhs.ndims () == 2
|         && (n_idx == 1
|             || (n_idx < 3
|                 && rhs.ndims () == 2
|                 && rhs.rows () == 0 && rhs.columns () == 0)))
|     ? assign2 (lhs, rhs, rfv) : assignN (lhs, rhs, rfv);
| 
| essentially assign2 is only called 2-D matrices with empty matrices for
| the RHS or for 2-D matrices indexed with 1 index vector. The first some
| case is trivial and just calls maybe_delete_elements, which is also in
| assignN. So the above might be simplified to
| 
| return (lhs.dims () == 2 && n_idx == 1) ? assign2 (lhs, rhs, rfv) :
|                       assignN (lhs, rhs, rfv);
| 
| in fact then perhaps assign2 might be significantly simplified, though
| I'd rather not do that just before a 3.0 release. In any case the above
| change makes no difference on the speed.

I'd actually like to have only one assign and one indexing function,
but I've never been able to figure out precisely what the rules are
for indexing so that Octave is compatible with the competition, or how
to express that in a general way.  In any case, any significant change
here should wait until after 3.0.

jwe


reply via email to

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