New answers tagged

8

Iterative Krylov-subspace solvers generally only require matrix-vector products and don't care whether or where there are zeros in the matrix. In your case, unless you have other information about the matrix (e.g., symmetry), you could for example use GMRES. What you probably had in mind is the question of preconditioning, and that you can't use things such ...


1

EDIT: I just noticed a glitch in your code. You used selfadjoint and triangular. Try this: L.triangularView<Lower>().transpose().solve(b); The rest of my answer may still be useful, so I won't delete it. Presumably, $L$ uses the column-major storage order. If not, just swap row for column everywhere in this post. $L^T$ can be represented by casting $L$...


2

Structural and numerical zeros describe how zero values in your matrix are stored. Structural zeros are zeros that are implied to be zero because they are not present in the data structure. Numerical zeros are zeros that are explicitly stored. For example, the matrix \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} can be stored in coordinate format ...


8

COO is an unsuitable matrix format except for particular purposes (e.g., if there is a substantial number of rows that have no entries at all, possibly with the exception of the diagonal). The way all large-scale codes I know of build the system matrix is through a three-step process: In the first step, you loop over all cells and figure out which entries ...


2

You don't do that for large and sparse matrices. It's an inefficient operation. Rather, you zero out the $n$th row and column and put a nonzero entry on the diagonal. Then you think about what operations that you wanted to do on the $99\times 99$ matrix need to look like on the modified $100\times 100$ matrix.


Top 50 recent answers are included