R/linalg.R
solve.mlx.Rd
Solve a system of linear equations
# S3 method for class 'mlx' solve(a, b = NULL, ...)
An mlx matrix (the coefficient matrix)
An mlx vector or matrix (the right-hand side). If omitted, computes the matrix inverse.
Additional arguments (for compatibility with base::solve)
An mlx object containing the solution.
mlx.linalg.solve
a <- mlx_matrix(c(3, 1, 1, 2), 2, 2) b <- as_mlx(c(9, 8)) solve(a, b) #> mlx array [2] #> dtype: float32 #> device: gpu #> values: #> [1] 2 3