7
votes
1answer
106 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
427 views

Speeding up construction of simple tridiagonal matrix

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