diff --git a/stim/math/matrix.h b/stim/math/matrix.h index 50a3b42..f4cbe42 100644 --- a/stim/math/matrix.h +++ b/stim/math/matrix.h @@ -38,14 +38,14 @@ struct matrix } //create a symmetric matrix given the rhs values, given in column-major order - CUDA_CALLABLE matrix setsym(T rhs[(N*N+N)/2]){ + CUDA_CALLABLE void setsym(T rhs[(N*N+N)/2]){ const size_t L = (N*N+N)/2; //store the number of values size_t r, c; r = c = 0; for(size_t i = 0; i < L; i++){ //for each value - if(r == c) M[c * n + r] = rhs[i]; - else M[c*n + r] = M[r * N + c] = rhs[i]; + if(r == c) M[c * N + r] = rhs[i]; + else M[c*N + r] = M[r * N + c] = rhs[i]; r++; if(r == N) r = ++c; } -- libgit2 0.21.4