Commit 2bd758a688290b09cab84460045a88492e61c12d

Authored by Jiaming Guo
1 parent 983bd6be

fix some minor errors.

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
stim/math/matrix.h
@@ -38,14 +38,14 @@ struct matrix @@ -38,14 +38,14 @@ struct matrix
38 } 38 }
39 39
40 //create a symmetric matrix given the rhs values, given in column-major order 40 //create a symmetric matrix given the rhs values, given in column-major order
41 - CUDA_CALLABLE matrix<T, N> setsym(T rhs[(N*N+N)/2]){ 41 + CUDA_CALLABLE void setsym(T rhs[(N*N+N)/2]){
42 const size_t L = (N*N+N)/2; //store the number of values 42 const size_t L = (N*N+N)/2; //store the number of values
43 43
44 size_t r, c; 44 size_t r, c;
45 r = c = 0; 45 r = c = 0;
46 for(size_t i = 0; i < L; i++){ //for each value 46 for(size_t i = 0; i < L; i++){ //for each value
47 - if(r == c) M[c * n + r] = rhs[i];  
48 - else M[c*n + r] = M[r * N + c] = rhs[i]; 47 + if(r == c) M[c * N + r] = rhs[i];
  48 + else M[c*N + r] = M[r * N + c] = rhs[i];
49 r++; 49 r++;
50 if(r == N) r = ++c; 50 if(r == N) r = ++c;
51 } 51 }