-
Notifications
You must be signed in to change notification settings - Fork 3
cysparse_implementation_overview
This is a quick overview of what has already been implemented in the CySparse library (and what is missing).
Two remarks:
- please, don't edit this page;
- tested means a full scale test with near 100% coverage. New code is systematically tested but with short tests and for some types, not all of them. Beside, many properties must/should be transferred for some operations (copy, sub matrix, views, etc.). This transfer has not been tested yet.
- Read-only attributes
- Commons operations
- Proxies in general
- Matrix multiplications
- Matrix translations
- Special matrices
- Matrix IO (serialization)
- Matrix printing
- Solvers
| Sign | Sigification |
|---|---|
| ✅ | OK. |
| 🔴 | Not done. |
| ✋ | On hold. |
| ➖ | Doesn't apply. |
| 🔜 | Could be done... one day but... . |
| 💥 | Potentially dangerous... |
| Attributes | ll_mat | csr_mat | csc_mat | Tested |
|---|---|---|---|---|
nrow, ncol
|
✅ | ✅ | ✅ | ✅ |
shape |
✅ | ✅ | ✅ | ✅ |
nnz |
✅ | ✅ | ✅ | ✅ |
store_symmetric |
✅ | ✅ | ✅ | ✅ |
is_hermitian |
🔜 | 🔜 | 🔜 | 🔜 |
store_zeros |
✅ | ✅ | ✅ | ✅ |
type_name |
✅ | ✅ | ✅ | 🔴 |
type |
✅ | ✅ | ✅ | 🔴 |
dtype, itype
|
✅ | ✅ | ✅ | 🔴 |
I guess the idea is to have the same behavior as for store_symmetric but that would be lots of work. For the moment, symmetric matrices can be constructed by storing only half of their elements. This requires dedicated code all the time (don't forget that our code is quite fine-tuned). Doing the same for hermitian matrices would require lots of work. Maybe later, if the need is real. For the moment, hermitian matrices are stored like normal matrices.
| Operation | ll_mat | csr_mat | csc_mat | Tested | Comments |
|---|---|---|---|---|---|
copy |
✅ | ✅ | ✅ | ✅ | Optimized with memcpy. The tests are only on the elements, not the attributes... |
diag |
✅ | ✅ | ✅ | ✅ | |
diags |
✅ | ✅ | ✅ | 🔴 | |
to_ndarray |
✅ | ✅ | ✅ | ✅ | Return NumPy equivalent full ndarray matrix. |
to_ll |
➖ | ✅ | ✅ | ✅ | |
take_triplet |
✅ | 🔴 | 🔴 | 🔴 | take |
put_triplet |
✅ | ➖ | ➖ | 🔴 |
put: CSR and CSC are immutable matrix types. |
find |
✅ | ✅ | ✅ | 🔴 | |
tril |
✅ | ✅ | ✅ | ✅ | Optimized for CSR and CSC. |
triu |
✅ | ✅ | ✅ | ✅ | Optimized for CSR and CSC. |
get_c_pointers |
➖ | ✅ | ✅ | 🔴 | 💥 C pointers to internal arrays. |
get_numpy_arrays |
➖ | ✅ | ✅ | 🔴 | 💥 NumPy arrays to internal arrays (no copy). |
| Proxy | State | Tested | Comment |
|---|---|---|---|
.T |
✅ | 🔴 | |
.H |
✅ | 🔴 | Only for complex matrices. |
.conj |
✅ | 🔴 | Only for complex matrices. |
LLSparseMatrixView |
✅ | 🔴 | Need rewriting now that we decided to drop masks. |
| Operation | State | Tested | Comment |
|---|---|---|---|
matvec |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with CSC- and CSRSparseMatrix matrices. |
matvec_transp |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with CSC- and CSRSparseMatrix matrices. |
matvec_htransp |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with CSC- and CSRSparseMatrix matrices. |
matvec_conj |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with CSC- and CSRSparseMatrix matrices. |
| Operation | State | Tested | Comment |
|---|---|---|---|
matdot |
✅ | 🔴 | Done for LLSparseMatrix and NumPy matrices. Not optimized (use of memory views). A * B. |
matdot_transp |
✅ | 🔴 | Done for LLSparseMatrix and NumPy matrices. Not optimized (use of memory views). A^t * B or A.T * B. |
matdot_transp_self |
✅ | 🔴 |
A^t * A or A.T * A. And the scaled version A^T * D * A with D=diag(d). Only for LLSparseMatrix. |
Nothing really stable for the moment.
| Operation | State | Tested | Comment |
|---|---|---|---|
matvec |
✅ | ✅ | All cases done and optimized.Tests done by comparing results with LLSparseMatrix matrices. |
matvec_transp |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with LLSparseMatrix matrices. |
matvec_htransp |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with LLSparseMatrix matrices. |
matvec_conj |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with LLSparseMatrix matrices. |
| Operation | State | Tested | Comment |
|---|---|---|---|
matdot |
🔴 | 🔴 | Nothing done |
matdot_transp |
🔴 | 🔴 | Nothing done |
None
| Operation | State | Tested | Comment |
|---|---|---|---|
matvec |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with LLSparseMatrix matrices. |
matvec_transp |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with LLSparseMatrix matrices. |
matvec_htransp |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with LLSparseMatrix matrices. |
matvec_conj |
✅ | ✅ | All cases done and optimized. Tests done by comparing results with LLSparseMatrix matrices. |
| Operation | State | Tested | Comment |
|---|---|---|---|
matdot |
🔴 | 🔴 | Nothing done |
matdot_transp |
🔴 | 🔴 | Nothing done |
None
Nothing!
None
All operations depend on the above implementations... Hooks exist but if above operation is not defined, it will not work...
| Operation | State | Tested | Comment |
|---|---|---|---|
matvec |
✅ | 🔴 | |
matvec_transp |
✅ | 🔴 | |
matvec_htransp |
✅ | 🔴 | |
matvec_conj |
✅ | 🔴 |
| Operation | State | Tested | Comment |
|---|---|---|---|
matvec |
✅ | 🔴 | |
matvec_transp |
✅ | 🔴 | |
matvec_htransp |
✅ | 🔴 | |
matvec_conj |
✅ | 🔴 |
| Operation | State | Tested | Comment |
|---|---|---|---|
matvec |
✅ | 🔴 | |
matvec_transp |
✅ | 🔴 | |
matvec_htransp |
✅ | 🔴 | |
matvec_conj |
✅ | 🔴 |
| Operation | State | Tested | Comment |
|---|---|---|---|
to_ndarray |
✅ | ✅ | |
to_ll |
➖ | ➖ | |
to_csc |
✅ | ✅ | |
to_csr |
✅ | ✅ |
| Operation | State | Tested | Comment |
|---|---|---|---|
to_ndarray |
✅ | ✅ | |
to_ll |
✅ | ✅ | |
to_csc |
➖ | ➖ | |
to_csr |
✅ | ✅ |
| Operation | State | Tested | Comment |
|---|---|---|---|
to_ndarray |
✅ | ✅ | |
to_ll |
✅ | ✅ | |
to_csc |
✅ | ✅ | |
to_csr |
➖ | ➖ |
| Matrix | State | Tested | Comment |
|---|---|---|---|
NewUnityLLSparseMatrix |
✅ | 🔴 | speye |
spzeros |
🆗 | 🆗 | Needed??? By default a sparse matrix is zero. |
NewDiagonalLLSparseMatrix |
✅ | 🔴 | spdiag |
NewBandLLSparseMatrix |
✅ | 🔴 |
spdiags but more general. |
NewArrowheadLLSparseMatrix |
✅ | 🔴 | Mainly for testing purpose |
NewLinearFillLLSparseMatrix |
✅ | 🔴 | Only for testing purpose |
To be done.
| Object | State | Tested | Comment |
|---|---|---|---|
LLSparseMatrix |
✅ | 🔴 | |
LLSparseMatrix.T |
✅ | 🔴 | |
LLSparseMatrix.H |
✅ | 🔴 | |
LLSparseMatrix.conj |
✅ | 🔴 | |
LLSparseMatrixView |
✅ | 🔴 | |
CSCSparseMatrix |
✅ | 🔴 | |
CSCSparseMatrix.T |
✅ | 🔴 | |
CSCSparseMatrix.H |
✅ | 🔴 | |
CSCSparseMatrix.conj |
✅ | 🔴 | |
CSRSparseMatrix |
✅ | 🔴 | |
CSRSparseMatrix.T |
✅ | 🔴 | |
CSRSparseMatrix.H |
✅ | 🔴 | |
CSRSparseMatrix.conj |
✅ | 🔴 |
| Operation | State | Tested | Comment |
|---|---|---|---|
LLSparseMatrix.__str__ |
✅ | 🔴 | |
LLSparseMatrix.__repr__ |
✅ | 🔴 | |
LLSparseMatrixView.__str__ |
✅ | 🔴 | |
LLSparseMatrixView.__repr__ |
✅ | 🔴 | |
CSCSparseMatrix.__str__ |
✅ | 🔴 | |
CSCSparseMatrix.__repr__ |
✅ | 🔴 | |
CSRSparseMatrix.__str__ |
✅ | 🔴 | |
CSRSparseMatrix.__repr__ |
✅ | 🔴 | |
LLSparseMatrix.T.__str__ |
✅ | 🔴 | |
LLSparseMatrix.T.__repr__ |
✅ | 🔴 | |
LLSparseMatrix.H.__str__ |
✅ | 🔴 | |
LLSparseMatrix.H.__repr__ |
✅ | 🔴 | |
LLSparseMatrix.conj.__str__ |
✅ | 🔴 | |
LLSparseMatrix.conj.__repr__ |
✅ | 🔴 |