Wed 04 Jun 2014 05:13:27 PM UTC, comment #8:
Well, there's not much left from my original patch - so thanks for keeping the author name. :)
|
Mon 02 Jun 2014 05:15:42 PM UTC, comment #7:
@Stefan: I compacted your Sparse-Sparse implementation and checked it in on the stable branche here (http://hg.savannah.gnu.org/hgweb/octave/rev/658d23da2c46).
Next, I added my modifications for the scalar-Sparse, Sparse-scalar routines (http://hg.savannah.gnu.org/hgweb/octave/rev/dccbc8bff5cb). I also added built-in self-tests (%!tests) which was part of the problem. The issue with the original changeset back in 3.2.X would have been caught if there had been tests for the sparse implementations.
Finally, I marked the atan2 functions which are part of the Sparse class as deprecated. They will be deleted in Octave 4.4. Nothing in the core is using these implementations, since everything is piped through binmap. However, there might be someone out there who is using atan2 directly in an oct-file so I thought I would give them some warning before removing the code.
|
Sun 01 Jun 2014 03:27:42 PM UTC, comment #6:
Rik, if you have time to review my patch, please use the latest one from here:
http://inversethought.com/hg/octave-nkf/graph/nkf-ready
Since I can't push to Jordis hg server, I attach my latest patch for the binmap - sparse/sparse problem
(file #31482)
|
Sun 01 Jun 2014 03:25:04 PM UTC, comment #5:
The problems with this section of code just keep expanding. In addition to no results, and infinite loops, the following code will cause a segfault.
I've re-written the scalar-Sparse and Sparse-scalar functions. It looks like Sparse-Sparse needs to be re-written as well.
|
Thu 29 May 2014 07:47:53 PM UTC, comment #4:
Yes, the infinite loop problem is located somewhere in the for-loop around oct-binmap.h:258
|
Thu 29 May 2014 03:25:13 PM UTC, comment #3:
Using Mercurial I have traced the problem back to changeset 6a271334750c. In that changeset the implementation of atan2, fmod, and hypot were switched over to binmap().
Indeed, the first problem that I reported with atan2 also exists for fmod.
So part of the problem seems to be that a scalar is not expanded in the same way as it would be for a full matrix. I won't have time to look at this or the submitted patch until the weekend.
|
Mon 20 Jan 2014 05:12:20 PM UTC, comment #2:
While debugging if found, this code ends in an infinite loop
|
Mon 20 Jan 2014 04:54:57 PM UTC, comment #1:
Attached a possible fix. Don't know if 'copy_or_memcopy' is ok here, but seems the be the fastest solution.
One option would be to copy the whole sparse matrix using existing method, but then data is copied for nothing. Other possibility is to rewrite column and row index within for loop, but this is slow. Third option: Create new method?
Also, MATLABs behaviour differs a little bit. This is also fixed with the attached patch.
This is the MATLAB result:
(file #30320)
|
Thu 05 Dec 2013 01:14:41 AM UTC, original submission:
atan2 seems to have been broken in the transition from 3.2 (works) to 3.4.
The following simple call to atan2 should work, but returns nothing instead.
For possible reference, there is atan2 code in liboctave/array/dSparse.cc but it is never called. Using gdb I found that the pathway is actually to the Sparse-Scalar template in liboctave/util/oct-binmap.h
|