Finally got around to working on this. A few comments:
Perhaps verify that I haven't introduced whitespace issues. I noticed that my Emacs inserted tabs where the file otherwise had none. Well, I fixed whatever I saw ...
Unrelated to the issue, I replaced 5 lines of code repeated throughout the file with a macro. It was too upsetting ...
I noticed that in several places you have ncol + 1, where ncol is an int. Note that ncol may take the value INT_MAX and in that case ncol + 1 will overflow. The patch does not attempt to address this.
I've used R_alloc somewhere, but maybe that is not idiomatic ... I needed to do a[i]++ and did not feel like checking whether that was legal for a of type IntegerVector rather than int * ...
Thanks for the follow-up! I had getting back to you on the TODO list has I was left a little bewildered and lost about what you wanted me to do. Will peruse the PR -- thanks for sending it in!
Finally got around to working on this. A few comments:
ncol + 1
, wherencol
is anint
. Note thatncol
may take the valueINT_MAX
and in that casencol + 1
will overflow. The patch does not attempt to address this.R_alloc
somewhere, but maybe that is not idiomatic ... I needed to doa[i]++
and did not feel like checking whether that was legal fora
of typeIntegerVector
rather thanint *
...