-
Notifications
You must be signed in to change notification settings - Fork 3
PySparse
Nikolaj edited this page Jul 7, 2015
·
86 revisions
Last update: July 7th, 2015
The next table gives a rough idea of what part of PySparse has been implemented in CySparse.
Don't forget that CySparse is much more general and that other methods/functionalities were added to LLSparseMatrix.
Roughly speaking, there are 37 interesting routines defined in ll_mat.c, of which 37 are implemented (or existing code must be adapated to the new version with types).
This is roughly 100%
-
col_scale: 8e3ed9bf93bd568264456af82b8321de82b39d3d -
row_scale: 1fa447c71c70d62160fd6198b19529a7383ee848 -
norm: 9873423e4e88d1021f4498accf26ae041bc14f1d -
generalize: 18090304d9dc9425d9daa54ccc5af28f3f2e73cd -
scale: 5f78e6b80e2e62ece0122821c407b1fc365c424c -
take_triplet: 00f83e9b85374ed0fb9d4d47030af85a2f3272ba -
shift: 8ebcd28553a32a0d3b7708dc4683ed97f9f9aace -
copy: 4744a3b3fc15ca403c43d6cd8eecb80d7b071230 -
clear_submatrix+delete_rows: 525e50e72d34ac296dacdc3c4c301de2fd7e54ae -
to_csr: a4114859c97f1e82393c919843c85a02c42b9469 -
matdot_transp: 2ca7071a2120aca4cca3d937ee34543afcfd250b -
update_add_at: c4e556bf9161ad3ac146a4785a55f55536ed2990 - new version of
put_triplet: 64f432aaeac0ccc7d5c7900ae1fa9b9401d4b3e1 -
matdot_transp_self: 3ab711ed77989e1d7fc0b71bfef843ab29d70767 -
delete_cols: 4458c657f5629a82e04f35a233cb871d827f084a
We don't use masks (for the moment).
Function ll_mat.c
|
Function ll_mat.pyx
|
Comments | Done |
|---|---|---|---|
PysparseIterator |
- | Not needed for the moment | 🆗 |
PysparseIterator_* |
- | " | 🆗 |
SpMatrix_LLMatBuildColIndex |
- | We use CSC and CSR
|
🆗 |
SpMatrix_LLMatDestroyColIndex |
- | " | 🆗 |
SpMatrix_LLMatGetItem |
at, safe_at, __getitem__
|
Improved version + bound testing | ✅ |
SpMatrix_LLMatSetItem |
put, safe_put, __setitem__
|
Same + bound testing | ✅ |
SpMatrix_LLMatUpdateItemAdd |
update_ll_mat_item_ add_@index@_@type@ |
Idem | ✅ |
LLMat_Compress |
compress |
Idem | ✅ |
create_indexlist |
create_c_ array_ indices_from_ python_ object_@index@ |
More elaborate with arrays | ✅ |
copySubMatrix_FromList |
- | Not needed, we use views | 🆗 |
getSubMatrix_FromList |
- | Not needed, we use views | 🆗 |
clear_submatrix |
clear_submatrix |
Idem. PySparse has never exported this method... | ✅ |
setSubMatrix_FromList |
- | Not needed, we use views | 🆗 |
ll_matvec_kernel |
multiply_ ll_mat_ with_ numpy_vector_ kernel_@index@ _@type@ |
Idem | ✅ |
ll_matvec_kernel_stride |
multiply_ ll_mat_ with_ strided_ numpy_vector_ kernel_@index@ _@type@ |
Idem | ✅ |
ll_matvec_kernel_sym |
multiply_sym_ ll_mat_ with_ numpy_vector_ kernel_@index@_ @type@ |
Idem | ✅ |
ll_matvec_kernel_stride_sym |
multiply_ ll_mat_ with_ strided_ numpy_vector_ kernel_@index@_ @type@ |
Idem | ✅ |
ll_matvec_transp_kernel |
multiply_tranposed_ ll_mat_ with_ numpy_vector_ kernel_@index@_ @type@ |
Idem | ✅ |
ll_matvec_transp_kernel_stride |
multiply_tranposed_ ll_mat_ with_ with_ strided_ numpy_vector_ kernel_@index@_ @type@ |
Idem | ✅ |
LLMat_matvec_transp |
matvec_transp, A.T * b
|
Idem + another method | ✅ |
LLMat_matvec |
matvec, A * b
|
Idem + another method | ✅ |
LLMat_col_scale |
col_scale |
This is one place where SpMatrix_ LLMat Build Col Index might be handy |
✅ |
LLMat_row_scale |
row_scale |
✅ | |
LLMat_to_csr |
to_csr |
Idem except column indices are not sorted | ✅ |
LLMat_to_sss |
- | Not needed | 🆗 |
LLMat_generalize |
generalize |
Idem | ✅ |
LLMat_export_mtx |
- | was done before | 🔸 |
LLMat_copy |
copy |
use of memcpy
|
✅ |
LLMat_update_add_at |
update_add_at |
Idem, but not out of bounds tests... | ✅ |
LLMat_norm |
norm |
Works for symmetric matrices | ✅ |
LLMat_shift |
shift |
Idem | ✅ |
LLMat_keys |
keys |
Idem | ✅ |
LLMat_values |
values |
Idem | ✅ |
LLMat_items |
items |
Idem | ✅ |
LLMat_scale |
scale, A *= b
|
Idem | ✅ |
LLMat_update_add_mask |
- | We don't use masks. | 🆗 |
LLMat_update_add_mask_sym |
- | We don't use masks. | 🆗 |
LLMat_take |
take_triplet |
Somewhat different | ✅ |
LLMat_put |
put_triplet |
Somewhat different | ✅ |
LLMat_delete_rows |
delete_rows_ with_mask, delete_row, delete_rows
|
Only int8 Numpy array for mask | ✅ |
LLMat_delete_cols |
delete_cols |
Idem but much slower (no use of mask) | ✅ |
LLMat_delete_rowcols |
- | Not needed. This method is really a call to delete_rows followed by delete_cols
|
🆗 |
LLMat_Find |
find |
Idem | ✅ |
LLMatType_dealloc |
__dealloc__ |
✅ | |
LLMatType_print |
print_to |
Idem but not satisfied | 🔸 |
LLMatType_getattr |
use of properties and attributes directly | No needed. | 🆗 |
LLMat_length |
- | Not needed. | 🆗 |
LLMat_subscript |
- | No needed , we use views | 🆗 |
LLMat_ass_subscript |
- | No needed, we use views | 🆗 |
LLMat_as_mapping |
- | No needed, we use views | 🆗 |
LLMatType |
LLSparseMatrix |
🆗 | |
SpMatrix_NewLLMatObject |
__cinit__ |
🆗 | |
LLMat_from_mtx |
- | Done before | 🔸 |
helper_getCArrayObject |
- | No needed | 🆗 |
LLMat_dot |
multiply_ transposed_ ll_mat_ by_ ll_mat_ @index@_@type@, A.T * B, matdot_ transp
|
Idem | ✅ |
LLMat_symdot |
matdot_transp_self |
Idem. | ✅ |
LLMat_parse_index |
- | No needed | 🆗 |