octave-maintainers
[Top][All Lists]
Advanced

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

Re: 3D versus 2D Indexing and the Speed Thereof


From: John W. Eaton
Subject: Re: 3D versus 2D Indexing and the Speed Thereof
Date: Tue, 10 Apr 2007 18:21:06 -0400

On 10-Apr-2007, Luis F. Ortiz wrote:

| A specialization that looked like:
| 
| 
|         template <class T>
|         int
|         assign2 (Array<T>& lhs, const Array<T>& rhs, const T& rfv)

Did you see my later message

  https://www.cae.wisc.edu/pipermail/octave-maintainers/2007-April/002451.html

?  I was only thinking of specializing the copy_strips function where
memcpy was used.

I just noticed a typo in the sample code I sent.  It should have been

  for (octave_idx_type j = 0; j < element_count; j++);
    raw_dest[j] = raw_source[j];

(my original message incorrectly used i for indexing raw_dest and
raw_source here).

| On the other hand, if we broke up assign2 into subfunctions that took
| care of the common 
| parts and were defined to be inline, the duplication could be kept to a
| minimum.  
| I would suspect that index() and assign() would in fact have common
| code.

Refactoring index and assign would also be OK, but I don't think it is
immediately necessary.

jwe


reply via email to

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