https://github.com/marcosalvalaggio/lana
Experimental Linear Algebra library written in Rust
https://github.com/marcosalvalaggio/lana
linear-algebra maturin numpy pyo3-rust-bindings python-rust-binding rust
Last synced: 2 months ago
JSON representation
Experimental Linear Algebra library written in Rust
- Host: GitHub
- URL: https://github.com/marcosalvalaggio/lana
- Owner: marcosalvalaggio
- License: mit
- Created: 2023-05-15T16:28:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-13T10:01:23.000Z (almost 2 years ago)
- Last Synced: 2025-01-17T22:36:42.563Z (4 months ago)
- Topics: linear-algebra, maturin, numpy, pyo3-rust-bindings, python-rust-binding, rust
- Language: Rust
- Homepage:
- Size: 70.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Lana 🧶

**L***inear* **A**lgebra for **n***octurnal* *and* **a**dventurous *data scientists.*
Lana is simply a repository for testing Python/Rust bindings and reproducing, on a micro scale, some of the functionalities of the great NumPy package. It's a work-in-progress memetic project aimed at having fun and learning new things.
## Install
Make sure you have the Rust language toolchain ([cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)) installed on your machine, and then:
```console
pip install lana
```## Manual Build
To build a package wheel, run the following command:
```console
pip install maturin
git clone https://github.com/marcosalvalaggio/lana.git
cd lana
maturin build --sdist
maturin develop
```## Example
```python
from lana import Matrix, injectzeros = Matrix.zeros((3,3))
print(zeros)
print(f"shape: {zeros.shape}, type: {type(zeros)}")
print(zeros.to_list()[0], zeros.to_list()[0][0])mat = Matrix.matrix([[1,2,3],[4,5,6]])
print(mat)
print(f"shape: {mat.shape}, type: {type(mat)}")
for rows in mat.to_list():
print(rows, type(rows))submat = Matrix.matrix(inject(mat.to_list()[0]))
print(submat)
print(submat.shape, type(submat))
```