gonum/internal API question

36 views
Skip to first unread message

Kunde21

unread,
Jun 11, 2016, 3:09:52 PM6/11/16
to gonum-dev
I didn't find any discussion on the matter, but I'm wondering if there's a need for the incrementing functions to use uintptr types for index, increment, and length parameters.  My main issue is with negative increments.  The asm side doesn't matter, but relying on overflow mechanics on the Go side just feels wrong.  It might even cause issues on some architectures (I only have access to amd64, so it's more of a nagging fear).  

ex:
f64.AxpyInc(alpha float64, x,y []float64, n, incX, incY, ix, iy uintptr)
f64.ScalInc(alpha float64, x []float64, n, incX uintptr)

All of those parameters would work and make more sense as ints.  I would expect most of the inputs to be stored as ints, too, so it would clean up the calling sites, as well.

Dan Kortschak

unread,
Jun 11, 2016, 5:00:09 PM6/11/16
to Kunde21, gonum-dev

The reason was a concern that int may not be always machine word size. There will be comments in the initial asm commits about this where I ask about it.

If you look into how it would impact on amd64 nacl and it's OK, I would be happy with the change, but I also would want others' input on the matter.

--
afk
Dan

--
You received this message because you are subscribed to the Google Groups "gonum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages