Mon 02 Nov 2015 04:01:21 AM UTC, comment #7:
I checked this in under your name on the development branch (http://hg.savannah.gnu.org/hgweb/octave/rev/3d8aee0b7415). Closing report.
|
Mon 14 Sep 2015 11:56:34 AM UTC, comment #6:
The attached patch implements the functionality requested.
Because of the constructor sparse(a), it can also assign, say, a 1x1x3 matrix to a 1x3 or 3x1 slice of a sparse matrix.
Please let me know if there are problems with this patch.
(file #34875)
|
Wed 29 Jul 2015 08:55:16 PM UTC, comment #5:
I'm sorry, I don't know how this message ended up here, this was supposed to go to another bug.
|
Wed 29 Jul 2015 08:51:37 PM UTC, comment #4:
Thanks to your suggestions I tested
dpkg -l 'blas'
ii libblas-common 1.2.20110419-10 amd64
ii libblas-dev 1.2.20110419-10 amd64
ii libblas3 1.2.20110419-10 amd64
ii libopenblas-base 0.2.12-1 amd64
ii libopenblas-dev 0.2.12-1 amd64
After
sudo apt-get purge libopenblas-base
it seems to work now.
The problem is, that purging openblas also purged Yade (because it is a dependency of libyade) which I need, but I guess this is a problem for the openblas or yade bug list :(
|
Thu 23 Jul 2015 06:39:21 PM UTC, comment #3:
Just checked with A(:,1), A(1,:), 1:4 and (1:4)'. Matlab will accept any combination.
It won't accept this abuse for non-vectors tho (sparse or full): A(:,1:2) = randn(4,2) works but A(:,1:2) = randn(2,4) gives "Subscripted assignment dimension mismatch", as you'd hope it would.
|
Thu 23 Jul 2015 06:31:26 PM UTC, comment #2:
Matlab tolerates it, I just checked.
% below is from Matlab 2013a
>> A=zeros(4,4);
>> A(:,1)=1:4
A =
1 0 0 0
2 0 0 0
3 0 0 0
4 0 0 0
>> A(1,:)=1:4
A =
1 2 3 4
2 0 0 0
3 0 0 0
4 0 0 0
>> A=sparse(4,4);
>> A(:,1)=1:4
A =
(1,1) 1
(2,1) 2
(3,1) 3
(4,1) 4
>> A(1,:)=1:4
A =
(1,1) 1
(2,1) 2
(3,1) 3
(4,1) 4
(1,2) 2
(1,3) 3
(1,4) 4
|
Thu 23 Jul 2015 04:05:56 AM UTC, comment #1:
Confirmed.
Do you have access to Matlab? It would be nice to see how they handle it.
But I agree it would be nice to make this compatible with the case of full matrices.
|
Mon 20 Jul 2015 09:16:15 PM UTC, original submission:
It's not really a bug, just a difference between sparse and full matrices. I guess sparse should be tolerant of this kind of abuse, just like it's full sibling :)
>> A=zeros(4,4);
>> A(:,1) = 1:4
A =
1 0 0 0
2 0 0 0
3 0 0 0
4 0 0 0
>> A=sparse(4,4);
>> A(:,1) = 1:4
error: A(I,J,...) = X: dimensions mismatch
>> A(:,1) = (1:4)'
A =
Compressed Column Sparse (rows = 4, cols = 4, nnz = 4 [25%])
(1, 1) -> 1
(2, 1) -> 2
(3, 1) -> 3
(4, 1) -> 4
>> full(A)
ans =
1 0 0 0
2 0 0 0
3 0 0 0
4 0 0 0
|