6
votes
1answer
101 views

Building sparse array from packed arrays

Suppose I have two large packed arrays a and b, that respectively contain the position of the elements of a square matrix (i.e. ...
9
votes
2answers
421 views

Speeding up construction of simple tridiagonal matrix

I have the following code to construct a tridiagonal matrix: ...