Mojo-Numerics-and-Algorithms-group / NuMojo

NuMojo is a library for numerical computing in Mojo 🔥 similar to numpy in Python.
Apache License 2.0
112 stars 15 forks source link

[fix] Fix the issues with `solve`, `inv`, and `matmul` #115

Closed forFudan closed 1 month ago

forFudan commented 1 month ago

This PR is to solve the issue with solve and inv due to problems in paralellization.

For solve: Disable the parallelism and use normal loop approach for the moment until the issue is resolved.

For inv: The approach to calculate inverse is to solve the system AB=I, where I is an identity matrix, with the function solve. This is also what Numpy does.

For matmul: It seems to be related to ASAP destruction policy and can be resolved by using the variables after the paralellization.