Fast matrix transforms
Project description
matvec
A domain-specific language for fast graph shift operations. This implements mathematical fields on numbers, n-dimensional column vectors, and n-by-n sparse matrices.
License: Apache Software License
Author: Emmanouil (Manios) Krasanakis
Dependncies: numpy
:zap: Quickstart
Creating a 5-dimensional vector:
from matvec import Vector
x = Vector([1, 2, 3, 4, 5])
Creating a 5x5 sparse matrix A in coo-format with non-zero elements A[1,2]=9 and A[3,0]=21
from matvec import Matrix
A = Matrix([1, 2],
[3, 0],
[9, 21],
5)
Print the outcome of matrix-vector multiplication:
print(A*x)
Print the outcome of left-multiplying transpose(x) with A:
print(x*A)
:fire: Features
:rocket: Parallelized matrix-vector multiplication.
:chart_with_downwards_trend: Memory reuse optimization.
:mag: numpy compatibility.
:factory: Common arithmetic operations.
:volcano: Benchmark
Current benchmark values are exhibited only on one machine. More rigorous evaluation will take place in the future.
Task | numpy/scipy | matvec |
---|---|---|
Allocate vectors with 2E6 elements | 0.101 sec | 0.106 sec |
1000 temp. additions with 2E6 elements | 4.067 sec | 2.265 sec |
Allocate matrix with 2E6 non-zeros | 0.231 sec | 0.073 sec |
Sparse matrix with vec multiplication | 0.024 sec | 0.012 sec |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for matvec-0.0.8-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef1ae10e354a465db07c0ca43c42efdf5fd99eaca6a8cf8f838bddb3a6698f9c |
|
MD5 | 4e576e988210a4bf89ee0025c7d329fe |
|
BLAKE2b-256 | 8ab096e765300691090e3c361b3efa284d589c370057f9184e450afd30fc8024 |