Questions on the construction and manipulation of sparse arrays in Mathematica, with functions like SparseArray[] and Band[].

learn more… | top users | synonyms

6
votes
1answer
231 views

How to create a large sparse block matrix

I need to generate a very large sparse block matrix, with blocks consisting only of ones along the diagonal. I have tried several ways of doing this, but I seem to always run out of memory. The ...
14
votes
1answer
288 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: ...
5
votes
2answers
269 views

How to interpret the FullForm of a SparseArray?

SparseArrays are atomic objects, but they do have a FullForm which reveals information about them. What is the meaning of the ...
10
votes
1answer
1k views

How to work around Mathematica hanging when showing a large SparseArray?

Note: This is fixed in 9.0.1. In Mathematica 9, if I display any large SparseArray object in the default way (which looks something like ...
5
votes
1answer
179 views

What's wrong with this code to create a matrix?

Here is my code: ...
10
votes
1answer
548 views

Sparse convolution of sparse arrays

The documentation for ListConvolve mentions that "ListConvolve works with sparse arrays", which is true. The result, however is never sparse, eg: ...
8
votes
2answers
373 views

Using ReplaceAll on SparseArray

I'm using SparseArray in a notebook in which I am doing complex conjugation manually, i.e. writing $\sqrt{-1}$ as i and applying ...
10
votes
2answers
445 views

Speeding up construction of simple tridiagonal matrix

I have the following code to construct a tridiagonal matrix: ...
3
votes
1answer
192 views

Efficiently importing XPM matrix data into Mathematica

The XPM file format is an image file format. Although it is primarily intended for icon pixmaps, it can also be used to store matrix data. For example, the GROMACS chemical simulation package uses ...
8
votes
1answer
830 views

Exporting a Large Multidimensional Sparse Array

I'm trying to export a sparse array from Mathematica to share with collaborators who primarily use Matlab. The sparse array in question is 4 dimensional, (72 x 93 x 94 x 172) with ~4M non-zero ...
3
votes
3answers
331 views

Support for Compressed Sparse Column sparse matrix representation

Is there native support for Compressed Sparse Column (CSC) format for sparse matrices, like importing and manipulating them?
17
votes
2answers
805 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 ...
6
votes
2answers
581 views

Efficient by-element updates to SparseArrays

I have a very large SparseArray called A. What is the most efficient way to update say element ...
16
votes
3answers
732 views

Efficient way to combine SparseArray objects?

I have several SparseArray objects, say sa11, sa12, sa21, sa22, which I would like to combine into the equivalent of {{sa11, sa12}, {sa21, sa22}}. As an example, I ...