# Questions tagged [sparse-arrays]

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

232 questions
Filter by
Sorted by
Tagged with
1answer
137 views

### Reorder matrix for nested dissection

I'm implementing a nested dissection linear solver outside of Mathematica and my original data is actually a graph, from which I have to construct an appropriate adjacency matrix to feed into the ...
0answers
33 views

### Odd behavior of ArrayReshape with SparseArrays

I am trying to understand why I am seeing inconsistent results when using ArrayReshape on a SparseArray vs. a normal nested <...
2answers
287 views

0answers
37 views

### 3D Sparse array [duplicate]

Following the 3D matrix representation shown here Vitaliy Kaurov's answer for "Plot 3D boolean Array or matrix in Mathematica" Is it possible to use a SparseArray ...
3answers
263 views

### Generating a (sparse?) array from data

I have a list: {{pos_1,val_1},{pos_2,val_2},...} and would like to generate an array of dimension d, with values ...
0answers
40 views

### NetTrain doesn't accept sparse input?

The following code fails to execute: ...
3answers
316 views

### Most efficient way to build block / banded SparseArray

I have a matrix that I generate with a procedure that looks like this: ...
3answers
94 views

### efficient replacing of certain diagonal parts of array/matrix

in writing some code for FEM i need an efficient way to replace parts of the diagonal of a sparse array. Certain positions in the diagonal of the array (given in a list) should be changed to "1". An ...
4answers
196 views

1answer
85 views

### How to fill in matrices by enforcing a condition on each entry quickly?

In the process of solving a 3D time-dependent PDE, I need to fill several matrices which their sizes are quite high. These matrices are constructed based on the radii of the mesh nodes in the 3 ...
3answers
117 views

I wrote: ...
1answer
924 views

### How to find position of non-zero elements in SparseArray without converting to a dense object

Overview So I have a SparseArray, sparse, constructed from a list of rules, with the dimension options. Given a row, I want to know where the values are non-zero. ...