-
Notifications
You must be signed in to change notification settings - Fork 3
PySparse
Nikolaj edited this page Jun 3, 2015
·
86 revisions
Last update: June 3rd, 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 45 interesting routines defined in ll_mat.c, of which 33 are implemented (or existing code must be adapated to the new version with types).
This is roughly 73%
-
col_scale: 8e3ed9bf93bd568264456af82b8321de82b39d3d -
row_scale: 1fa447c71c70d62160fd6198b19529a7383ee848 -
norm: 9873423e4e88d1021f4498accf26ae041bc14f1d -
generalize: 18090304d9dc9425d9daa54ccc5af28f3f2e73cd -
scale: 5f78e6b80e2e62ece0122821c407b1fc365c424c -
take_triplet: 00f83e9b85374ed0fb9d4d47030af85a2f3272ba -
shift: 8ebcd28553a32a0d3b7708dc4683ed97f9f9aace -
copy: 4744a3b3fc15ca403c43d6cd8eecb80d7b071230 -
clear_submatrix+delete_rows: 525e50e72d34ac296dacdc3c4c301de2fd7e54ae
Function ll_mat.c
|
Function ll_mat.pyx
|
Comments | Done |
|---|---|---|---|
PysparseIterator |
- | No need 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 |
- | 🔴 | |
getSubMatrix_FromList |
- | 🔴 | |
clear_submatrix |
clear_submatrix |
Idem | ✅ |
setSubMatrix_FromList |
- | 🔴 | |
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 |
- | Was done before | 🔸 |
LLMat_to_sss |
- | No need for | 🆗 |
LLMat_generalize |
generalize |
Idem | ✅ |
LLMat_export_mtx |
- | was done before | 🔸 |
LLMat_copy |
copy |
use of memcpy
|
✅ |
LLMat_update_add_at |
- | 🔴 | |
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 |
- | 🔴 | |
LLMat_update_add_mask_sym |
- | 🔴 | |
LLMat_take |
take_triplet |
Somewhat different | ✅ |
LLMat_put |
put_triplet |
Somewhat different | ✅ |
LLMat_delete_rows |
delete_rows_ with_mask |
Only int8 Numpy array for mask | ✅ |
LLMat_delete_cols |
- | 🔴 | |
LLMat_delete_rowcols |
- | 🔴 | |
LLMat_Find |
find |
Idem | ✅ |
LLMatType_dealloc |
__dealloc__ |
✅ | |
LLMatType_print |
print_to |
Idem but not satisfied | 🔸 |
LLMatType_getattr |
use of properties and attributes directly | No need for | 🆗 |
LLMat_length |
- | Do we need this? | ❓ |
LLMat_subscript |
- | No need for, we use views | 🆗 |
LLMat_ass_subscript |
- | No need for, we use views | 🆗 |
LLMat_as_mapping |
- | No need for, we use views | 🆗 |
LLMatType |
LLSparseMatrix |
🆗 | |
SpMatrix_NewLLMatObject |
__cinit__ |
🆗 | |
LLMat_from_mtx |
- | Done before | 🔸 |
helper_getCArrayObject |
- | No need for | 🆗 |
LLMat_from_csr |
- | 🔴 | |
LLMat_from_csc |
- | 🔴 | |
LLMat_dot |
- | 🔴 | |
LLMat_symdot |
- | 🔴 | |
LLMat_parse_index |
- | No need for | 🆗 |