Registered Member
|
I want to add a sparse vector with a common vector,like the following " vxd= vec + vxd ",However,the error is "no match for 'operator +' in 'vec + vxd' ".I would like to know how should i do can deal with the situation like this.Thank you!
|
Registered Member
|
Hi,
It seems that you mixed "row major vector" with "row vector". The RowMajor you specified in SparseVector is the way that values are stored, but it is still a column vector. So the error is due to the fact that you are adding a row vector to a column vector. |
Moderator
|
The "problem" is that only compound assignment from sparse to dense is allowed, like:
vxd += vec; |
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar