Midterm Blog Post

I’ve neglected this blog.  Sorry

What I’ve done so far:

Changeset 1: Removed second internal representation from PermMatrix (all PermMatrix are strictly column-major now): Accepted!

Changeset 2: Created a generic templated “find” method which consolidates the many different implementations of “find”.  This change includes adding nz_iterators, ie iterators over the nonzero elements of any of the four array types (Array, Sparse, DiagArray2, PermMatrix): Pending jwe’s review

Changeset 3: Added a “dispatch” function which dispatches interpreter function calls to the proper matrix template-type.  jwe warned that the community might be uncomfortable with such a major change, but so far the community’s been almost entirely unresponsive except for one enthusiastic and supportive email from Carne. (Thanks!)

Note, these first three changesets have not changed significantly since I implemented them in the FIRST WEEK of GSoC, yet only one of them has actually been fully reviewed and accepted so far.


 

Changeset 4 WIP: Started working on an “accumulate” function to use as the back-end implementation of sum, product, any, all, min, and max.  In particular I was writing a version that will properly accumulate over the rows of tall sparse matrices.  I stopped this in the middle and figured I’d come back to it.  I still plan to

Changeset 5: Added bounds-checking and reference-checking to Array::xelem (when debugging options are turned on).  I’ve been advised I should profile this change, but there aren’t any recommendations on what benchmark to use.  Experience suggests whatever benchmark I use, the community won’t accept it.

Changeset 6 WIP: Logical indexing into sparse matrices.  This is the primary change my GSoC project is meant to be centered around.  I have implemented a form of it, but it doesn’t yet handle any of the edge cases.  Also my implementation relies heavily on the iterators and dispatch function from changesets 2 and 3 respectively so if jwe ultimately doesn’t accept those, then I don’t know what I’ll do.

Experimenting with Matlab shows that Matlab will reshape the index matrix to match the height of the result matrix and Matlab’s reshape apparently use >64-bit arithmetic to determine the size of the resulting matrix.  This leaves me in somewhat of a bind because if I want to do the same, I need to add gmp as a dependency, but no one wants to add new dependencies.

Considering that in this particular instance, I’m guaranteed to know the column height (and nobody asked me to re-implement reshape so I won’t), I think I’ll just use repeated addition/subtraction to do the multiply and and divide.  It will still run in only O(#columns) running time which is how long a reshape should take.


 

On one hand, I’m nearly done with the primary thing my project is supposed to do.  That’s good.  But on the other hand I should have finished it and have moved on to other stuff by now.  I understand that community/mentor approval is an important thing, but if the community is really so strict, then why is Octave such a mess of buggy copy-pasted ill-considered code?  Who approved all of that?

 

Leave a comment