changeset 12532:4d5e57cdfce8 octave-forge

fix to a last commit's bug: the following used to give at random incorrect results: octave --eval "A=sparse([1,2,3,3],[1,2,3,1],[1,1,1,2]) ; C=complex(A); x=[10,100;20,200;30,300]*i; A,C,x,((sparse(A)*x)-(sparsersb(A)*x)), sparse(A)'*x-sparsersb(A)'*x"
author michelemartone
date Sat, 18 Oct 2014 12:25:01 +0000
parents f39400293307
children 06385baaee3e
files main/sparsersb/src/sparsersb.cc
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main/sparsersb/src/sparsersb.cc	Sat Oct 18 11:57:51 2014 +0000
+++ b/main/sparsersb/src/sparsersb.cc	Sat Oct 18 12:25:01 2014 +0000
@@ -1151,7 +1151,7 @@
 	octave_idx_type ldb=b_nr;
 	octave_idx_type ldc=do_trans?this->columns():this->rows();
 	octave_idx_type nrhs=b_nc;
-	ComplexMatrix retval(ldc,nrhs/*,RSBOI_ZERO*/); /* RSBOI_ZERO is unnecessary: we zero in rsb_spmm */
+	ComplexMatrix retval(ldc,nrhs,RSBOI_ZERO); /* zeroing is in principle unnecessary (we zero in rsb_spmm), but otherwise data may not be allocated. */
 	RSBOI_T* Cp =(RSBOI_T*)retval.data();
 	RSBOI_T* Bp =(RSBOI_T*)b.data();