March 2019
Intermediate to advanced
336 pages
9h 9m
English
A sparse matrix is a two-dimensional list of m rows and n columns. The shape of a matrix is m x n if it consists of m rows and n columns. Sparse matrices are used for solving large-scale problems that do not require dense matrices. For example, partial differential equations are solved by using the finite element method (FEM). Tuples of a sparse matrix are non-zero elements of the matrix.
In the following code, a sparse matrix is modeled as a list of lists. A sparse matrix consists of cells that are a list of lists. Each cell has properties such as Row, Column, and Value:
///main package has examples shown// in Go Data Structures and algorithms bookpackage main// importing fmt packageimport ...
Read now
Unlock full access