octave-maintainers
[Top][All Lists]
Advanced

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

Re: C++ version of regexprep.cc


From: David Bateman
Subject: Re: C++ version of regexprep.cc
Date: Wed, 03 May 2006 21:51:40 +0200
User-agent: Thunderbird 1.5 (Windows/20051201)

Paul Kienzle wrote:

The splitting step is now a much more reasonable 2.5 seconds.

The remainder of the file is messy for loops which could
probably be made faster if the code was restructured.

The code is full of puzzles such as the following:

   iis='i1';
   for ii=2:length(w.size);
     iis=[iis,',i',num2str(ii)];
   end
   nn=prod(w.size); %number of elements
   eval(['[',iis,']=ind2sub(w.size,[1:nn]);']); % generation of indexes
   iis='i1(ind)';
   for ii=2:length(w.size);
     iis=[iis,',i',num2str(ii),'(ind)'];
   end % indexes of indexes
   for ind=1:nn
     eval(['valor(',iis,')=tag_contents{i,4}(ind);'])
   end
   if exist('valor')==1;
     tag_contents{i,4}=valor;
     clear valor;
   end

Which as far as I can tell is just:

   tag_contents{i,4} = reshape(tag_contents{i,4},w.size);

The latter runs much faster 8-)

With the above transformation, I can now get almost all the way
through in reasonable time.

Now it is hitting a 'max recursion limit exceeded' message in
code even uglier than the above.  In addition, I believe this
code relies on the fact that fields in a structure are ordered.
Is this code that matlab runs? If so then perhaps octave maximm recursion limit is smaller than matlabs. I'd suggest it shouldn't be for compatiability. Can this code be used to read the same file under matlab?

So again I declare defeat and say this code cannot be made to
run in Octave.
If it works in matlab for your test file, then I suspect there is something else we should be doing..

D,


Thanks for trying.

    - Paul




reply via email to

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