Fixed error in generate weights function where I put the matrix in column major for the test