Rmlx provides S3 methods for a number of base R generics so that common
operations keep working after converting objects with as_mlx(). The main
entry points are:
Details
%*%for matrix multiplicationSummaryfor reductions such assum()andmax(); alsomean(),length()andall.equal().as.matrix(),as.array(), andas.vector()for conversion back to base Rrow()andcol()for index helpers that play nicely with mlx arrayscbind()andrbind()for binding arrays along rows or columns; there is also anabind()function modelled onabind::abind().rowMeans(),colMeans(),rowSums(), andcolSums()for axis-wise summarieskronecker(),outer(),crossprod(), andtcrossprod()for linear algebra helpersfft(),chol(),chol2inv(),backsolve(), andsolve()for numerical routinesscale()for column-wise centring and scaling that stays on the MLX backendasplit()to slice arrays along a margin while staying on the MLX backend
Most methods return mlx objects. One exception is that all() and any()
return standard R TRUE or FALSE when used on mlx objects.