4
votes
2answers
100 views

Values (or positions) of array row elements within a specified number of positions from target value

I have the need to collect values from the rows of rectangular arrays of arbitrary precision integers, given a target element value and allowed "distance" (positions +/- within the row from found ...
0
votes
0answers
44 views

Addition of sparse array objects [duplicate]

I have been having some trouble with the addition of large (but very sparse) matrices using SparseArray. Here is the simplest example to illustrate the issue. First, I will define diagonal matrices ...
9
votes
2answers
276 views

Speed up 4D matrix/array generation

I have to fill a 4D array, whose entries are $\mathrm{sinc}\left[j(a-b)^2+j(c-d)^2-\phi\right]$ for a fixed value of $\phi$ (normally -15) and a fixed value of $j$ (normally about 0.00005). The way ...
14
votes
1answer
252 views

Adding three integer sparse matrices is very slow. Adding only two is fast

Adding more than two sparse matrices in one step in Mathematica 9 is very slow (in fact I couldn't even wait for it to finish). Here's an example. Let's generate a large sparse matrix: ...
9
votes
2answers
384 views

Speeding up construction of simple tridiagonal matrix

I have the following code to construct a tridiagonal matrix: ...
16
votes
2answers
692 views

Using the Krylov method for Solve: Speeding up a SparseArray calculation

I'm trying to implement this Total Variation Regularized Numerical Differentiation (TVDiff) code in MMA (which I found through this SO answer): essentially I want to differentiate noisy data. The full ...