https://github.com/johann-petrak/python-sparsevectors
A simple fast sparse vectors module based on defaultdict(float)
https://github.com/johann-petrak/python-sparsevectors
python-extension python3 sparse-vectors
Last synced: 10 months ago
JSON representation
A simple fast sparse vectors module based on defaultdict(float)
- Host: GitHub
- URL: https://github.com/johann-petrak/python-sparsevectors
- Owner: johann-petrak
- License: other
- Created: 2017-06-10T18:02:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-14T16:30:35.000Z (over 8 years ago)
- Last Synced: 2025-01-13T06:41:31.622Z (11 months ago)
- Topics: python-extension, python3, sparse-vectors
- Language: C
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
========
sparsevectors
========
A library that provides the SparseVector object which is defaultdict(float) with
the following properties and methods:
- getting a non-existing element always returns 0.0
- method dot(other) returns the dot-product between this SparseVector and another
- method iaddc(other[,weight]) adds to each element in this SparseVector the
corresponding element of the other SparseVector, multiplied by weight, if given.
If the result is 0.0, then the element in the current SparseVector is removed
Authors
-------
This code is based on the cpython defaultdict code (see https://github.com/python/cpython)
and is inspired by Liang Huang's (http://web.engr.oregonstate.edu/~huanlian) hvector
library (http://web.engr.oregonstate.edu/~huanlian/software/hvector-1.0.tar.bz).
Any errors are mine though.
* Johann Petrak
* Liang Huang
* Authors and contributors to CPython's _collectionsmodule.c
Status
------
This is still an early version and may contain bugs, memory leaks.
Any help to make it better or in finding and squashing bugs is welcome.
Installation
------------
TBD
License
-------
Licensed under the terms of the `CPython License`_. See attached file LICENSE.txt.
.. _CPython License: https://github.com/python/cpython/blob/master/LICENSE