jonocarroll / vec

A New Vector Class With Added Functionality
https://jonocarroll.github.io/vec/
GNU General Public License v3.0
4 stars 0 forks source link

Ops support and array broadcasting #2

Open jonocarroll opened 2 days ago

jonocarroll commented 2 days ago

Support Ops group operations, but potentially not with base R's recycling rules.

https://mc-stan.org/posterior/articles/rvar.html#broadcasting

cc: @mjskay

DavisVaughan commented 1 day ago

If you're going to seriously look at broadcasting, take a look at https://rray.r-lib.org/articles/broadcasting.html

I would highly recommend these rules as they are (i think) theoretically sound and are also what numpy uses (just applied to R's column major arrays rather than row major ones)