Closed tolgap closed 10 years ago
xinc
and yinc
must be set to one.
It only changes the first element (to some random? number). What am I doing wrong?
It's doing what you asked it to do, with xinc = yinc = 0
and n = 6
, it's calling *y += alpha * *x
six times.
@japaric that fixed it, thank you. I thought xinc
and yinc
were supposed to increment all x
and y
elements by some value, hence I set it to 0
.
I'm trying to expand the operations on matrices. I'm in the process of adding addition to
Mat<T>
. I useBlasAxpy::axpy
to do this (even though it's only a level 1 BLAS operation. The LLVM backend will surely optimize a matrix-matrix addition as it's only a vector-vector addition) for the sake of consistency.But I run into issues with wrong answers.
When I try to debug the issues, using this simple script, I get strange answers:
Output is:
It only changes the first element (to some random? number). What am I doing wrong?