Linked Questions

0
votes
0answers
195 views

What is stored for a sparse matrix in memory? [duplicate]

I am wondering if a sparse matrix is stored in memory as a list which is its ArrayRules? The reason to ask this is I am trying to write a function to produce a large sparse matrix. However, I am not ...
5
votes
0answers
135 views

SparseArray internal structure [duplicate]

According to the documentation: SparseArray is treated as a raw object by functions like AtomQ and for purposes of pattern ...
40
votes
5answers
3k views

How to estimate geodesics on discrete surfaces?

Continuing with my interest on curvature of discrete surfaces here and here, I would like to also calculate and plot geodesics on discretised (triangulated) surfaces. Basically, my long-term idea ...
57
votes
2answers
2k views

What are SparseArray Properties? How and when should they be used?

A strange undocumented form of SparseArray is increasingly used in answers on this site: ...
20
votes
3answers
2k 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 ...
23
votes
2answers
1k views

Speeding up generation of block diagonal matrix

I'm struggling with the following problem. I have $48$ square matrices (full, filled with real machine precision numbers, thus are packed, all different) of size $128$. I wolud like to place them on a ...
11
votes
3answers
441 views

Most efficient way to build block / banded SparseArray

I have a matrix that I generate with a procedure that looks like this: ...
5
votes
1answer
405 views

Isn't it possible to Pack a SparseArray?

I have the following matrix Va: ...
6
votes
1answer
479 views

How to find k largest element and their position in a matrix?

I have a sparse matrix, and I am interested in find k largest elements and their positions in the matrix. I do it in the following manner: ...
7
votes
1answer
404 views

How to speed up this TDSE code?

I'm trying to build a 1D time-dependent Schrodinger equation solver, using the Crank-Nicholson method. And I think the code is kind of working now, but the speed is still slow for me. Here is the ...
11
votes
2answers
467 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. <...
2
votes
3answers
328 views

How to store the nonzero elements of a sparse array in a file? [duplicate]

Often I need to use same matrix several times and for that I save them in an external file. Converting the matrix into SparseArray can save a lot of space in this ...
11
votes
1answer
255 views

Fast way to reassemble SparseArrays

I often have to deal with nonlinear shape optimization problems involving curves or surfaces surfaces. A classical example is Plateau's problem. No matter if I use gradient-based techniques (such as ...
7
votes
1answer
185 views

Efficiently populate sparse matrix with band structure

I'm trying to efficiently populate elements of a very large (2^20 x 2^20) symmetric matrix with 1s - luckily the matrix is very sparse, <0.1% filling. Further, the matrix has a very well defined ...
3
votes
1answer
381 views

Jacobian for parallelised FindRoot with multiple variables

Michael E2 explains how to use parallel processing to speed up multiple FindRoot calculation with the same function in https://mathematica.stackexchange.com/a/...

15 30 50 per page