-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Consider the following example in the python shell:
>>> import numpy as np
>>> from cysparse.sparse.ll_mat import LLSparseMatrix
>>> A = LLSparseMatrix(size=5,size_hint=9,store_symmetric=True)
>>> B = LLSparseMatrix(nrow=1,ncol=4,size_hint=4)
>>> A.put_triplet(range(5),range(5),np.ones(5))
>>> B.put_triplet([0]*4,[0,1,2,3],5*np.ones(4,dtype=np.float64))
>>> A[4:5,:4] = B
>>> print AThe desired output should be:
1.000000 --- --- --- 5.000000
--- 1.000000 --- --- 5.000000
--- --- 1.000000 --- 5.000000
--- --- --- 1.000000 5.000000
5.000000 5.000000 5.000000 5.000000 1.000000
I.e., the nonsymmetric block is copied twice to maintain the symmetry of A. Instead, we get this:
1.000000 --- --- --- ---
--- 1.000000 --- --- ---
--- --- 1.000000 --- ---
--- --- --- 1.000000 ---
5.000000 --- --- --- 1.000000
which is not only asymmetric but also fails to fully copy B.
The construction A[4:5,:4] = B was fine in Pysparse and it would be really nice to have the same capability in Cysparse. In the meantime, is there a workaround?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels