<s>
In	O
numerical	B-General_Concept
analysis	I-General_Concept
and	O
scientific	O
computing	O
,	O
a	O
sparse	B-Algorithm
matrix	I-Algorithm
or	O
sparse	B-Algorithm
array	I-Algorithm
is	O
a	O
matrix	B-Architecture
in	O
which	O
most	O
of	O
the	O
elements	O
are	O
zero	O
.	O
</s>
<s>
There	O
is	O
no	O
strict	O
definition	O
regarding	O
the	O
proportion	O
of	O
zero-value	O
elements	O
for	O
a	O
matrix	B-Architecture
to	O
qualify	O
as	O
sparse	O
but	O
a	O
common	O
criterion	O
is	O
that	O
the	O
number	O
of	O
non-zero	O
elements	O
is	O
roughly	O
equal	O
to	O
the	O
number	O
of	O
rows	O
or	O
columns	O
.	O
</s>
<s>
By	O
contrast	O
,	O
if	O
most	O
of	O
the	O
elements	O
are	O
non-zero	O
,	O
the	O
matrix	B-Architecture
is	O
considered	O
dense	O
.	O
</s>
<s>
The	O
number	O
of	O
zero-valued	O
elements	O
divided	O
by	O
the	O
total	O
number	O
of	O
elements	O
(	O
e.g.	O
,	O
m	O
×	O
n	O
for	O
an	O
m	O
×	O
n	O
matrix	B-Architecture
)	O
is	O
sometimes	O
referred	O
to	O
as	O
the	O
sparsity	B-Algorithm
of	O
the	O
matrix	B-Architecture
.	O
</s>
<s>
Conceptually	O
,	O
sparsity	B-Algorithm
corresponds	O
to	O
systems	O
with	O
few	O
pairwise	O
interactions	O
.	O
</s>
<s>
For	O
example	O
,	O
consider	O
a	O
line	O
of	O
balls	O
connected	O
by	O
springs	O
from	O
one	O
to	O
the	O
next	O
:	O
this	O
is	O
a	O
sparse	B-Algorithm
system	I-Algorithm
as	O
only	O
adjacent	O
balls	O
are	O
coupled	O
.	O
</s>
<s>
By	O
contrast	O
,	O
if	O
the	O
same	O
line	O
of	O
balls	O
were	O
to	O
have	O
springs	O
connecting	O
each	O
ball	O
to	O
all	O
other	O
balls	O
,	O
the	O
system	O
would	O
correspond	O
to	O
a	O
dense	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
The	O
concept	O
of	O
sparsity	B-Algorithm
is	O
useful	O
in	O
combinatorics	O
and	O
application	O
areas	O
such	O
as	O
network	O
theory	O
and	O
numerical	B-General_Concept
analysis	I-General_Concept
,	O
which	O
typically	O
have	O
a	O
low	O
density	O
of	O
significant	O
data	O
or	O
connections	O
.	O
</s>
<s>
Large	O
sparse	B-Algorithm
matrices	I-Algorithm
often	O
appear	O
in	O
scientific	O
or	O
engineering	O
applications	O
when	O
solving	O
partial	O
differential	O
equations	O
.	O
</s>
<s>
When	O
storing	O
and	O
manipulating	O
sparse	B-Algorithm
matrices	I-Algorithm
on	O
a	O
computer	O
,	O
it	O
is	O
beneficial	O
and	O
often	O
necessary	O
to	O
use	O
specialized	O
algorithms	O
and	O
data	B-General_Concept
structures	I-General_Concept
that	O
take	O
advantage	O
of	O
the	O
sparse	O
structure	O
of	O
the	O
matrix	B-Architecture
.	O
</s>
<s>
Specialized	O
computers	O
have	O
been	O
made	O
for	O
sparse	B-Algorithm
matrices	I-Algorithm
,	O
as	O
they	O
are	O
common	O
in	O
the	O
machine	O
learning	O
field	O
.	O
</s>
<s>
Operations	O
using	O
standard	O
dense-matrix	O
structures	O
and	O
algorithms	O
are	O
slow	O
and	O
inefficient	O
when	O
applied	O
to	O
large	O
sparse	B-Algorithm
matrices	I-Algorithm
as	O
processing	O
and	O
memory	B-General_Concept
are	O
wasted	O
on	O
the	O
zeros	O
.	O
</s>
<s>
Sparse	O
data	O
is	O
by	O
nature	O
more	O
easily	O
compressed	B-General_Concept
and	O
thus	O
requires	O
significantly	O
less	O
storage	B-General_Concept
.	O
</s>
<s>
Some	O
very	O
large	O
sparse	B-Algorithm
matrices	I-Algorithm
are	O
infeasible	O
to	O
manipulate	O
using	O
standard	O
dense-matrix	O
algorithms	O
.	O
</s>
<s>
A	O
matrix	B-Architecture
is	O
typically	O
stored	O
as	O
a	O
two-dimensional	O
array	O
.	O
</s>
<s>
Each	O
entry	O
in	O
the	O
array	O
represents	O
an	O
element	O
of	O
the	O
matrix	B-Architecture
and	O
is	O
accessed	O
by	O
the	O
two	O
indices	B-Data_Structure
and	O
.	O
</s>
<s>
For	O
an	O
matrix	B-Architecture
,	O
the	O
amount	O
of	O
memory	B-General_Concept
required	O
to	O
store	O
the	O
matrix	B-Architecture
in	O
this	O
format	O
is	O
proportional	O
to	O
(	O
disregarding	O
the	O
fact	O
that	O
the	O
dimensions	O
of	O
the	O
matrix	B-Architecture
also	O
need	O
to	O
be	O
stored	O
)	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
a	O
sparse	B-Algorithm
matrix	I-Algorithm
,	O
substantial	O
memory	B-General_Concept
requirement	O
reductions	O
can	O
be	O
realized	O
by	O
storing	O
only	O
the	O
non-zero	O
entries	O
.	O
</s>
<s>
Depending	O
on	O
the	O
number	O
and	O
distribution	O
of	O
the	O
non-zero	O
entries	O
,	O
different	O
data	B-General_Concept
structures	I-General_Concept
can	O
be	O
used	O
and	O
yield	O
huge	O
savings	O
in	O
memory	B-General_Concept
when	O
compared	O
to	O
the	O
basic	O
approach	O
.	O
</s>
<s>
The	O
trade-off	O
is	O
that	O
accessing	O
the	O
individual	O
elements	O
becomes	O
more	O
complex	O
and	O
additional	O
structures	O
are	O
needed	O
to	O
be	O
able	O
to	O
recover	O
the	O
original	O
matrix	B-Architecture
unambiguously	O
.	O
</s>
<s>
Those	O
that	O
support	O
efficient	O
modification	O
,	O
such	O
as	O
DOK	O
(	O
Dictionary	B-Application
of	O
keys	O
)	O
,	O
LIL	O
(	O
List	O
of	O
lists	O
)	O
,	O
or	O
COO	O
(	O
Coordinate	O
list	O
)	O
.	O
</s>
<s>
Those	O
that	O
support	O
efficient	O
access	O
and	O
matrix	B-Architecture
operations	O
,	O
such	O
as	O
CSR	O
(	O
Compressed	B-General_Concept
Sparse	O
Row	O
)	O
or	O
CSC	O
(	O
Compressed	B-General_Concept
Sparse	O
Column	O
)	O
.	O
</s>
<s>
DOK	O
consists	O
of	O
a	O
dictionary	B-Application
that	O
maps	O
-pairs	O
to	O
the	O
value	O
of	O
the	O
elements	O
.	O
</s>
<s>
Elements	O
that	O
are	O
missing	O
from	O
the	O
dictionary	B-Application
are	O
taken	O
to	O
be	O
zero	O
.	O
</s>
<s>
The	O
format	O
is	O
good	O
for	O
incrementally	O
constructing	O
a	O
sparse	B-Algorithm
matrix	I-Algorithm
in	O
random	O
order	O
,	O
but	O
poor	O
for	O
iterating	O
over	O
non-zero	O
values	O
in	O
lexicographical	O
order	O
.	O
</s>
<s>
One	O
typically	O
constructs	O
a	O
matrix	B-Architecture
in	O
this	O
format	O
and	O
then	O
converts	O
to	O
another	O
more	O
efficient	O
format	O
for	O
processing	O
.	O
</s>
<s>
This	O
is	O
another	O
format	O
good	O
for	O
incremental	O
matrix	B-Architecture
construction	O
.	O
</s>
<s>
This	O
is	O
another	O
format	O
that	O
is	O
good	O
for	O
incremental	O
matrix	B-Architecture
construction	O
.	O
</s>
<s>
The	O
compressed	B-General_Concept
sparse	O
row	O
(	O
CSR	O
)	O
or	O
compressed	B-General_Concept
row	O
storage	B-General_Concept
(	O
CRS	O
)	O
or	O
Yale	O
format	O
represents	O
a	O
matrix	B-Architecture
by	O
three	O
(	O
one-dimensional	O
)	O
arrays	O
,	O
that	O
respectively	O
contain	O
nonzero	O
values	O
,	O
the	O
extents	O
of	O
rows	O
,	O
and	O
column	O
indices	B-Data_Structure
.	O
</s>
<s>
It	O
is	O
similar	O
to	O
COO	O
,	O
but	O
compresses	O
the	O
row	O
indices	B-Data_Structure
,	O
hence	O
the	O
name	O
.	O
</s>
<s>
This	O
format	O
allows	O
fast	O
row	O
access	O
and	O
matrix-vector	O
multiplications	O
(	O
)	O
.	O
</s>
<s>
The	O
CSR	O
format	O
stores	O
a	O
sparse	O
matrix	B-Architecture
in	O
row	O
form	O
using	O
three	O
(	O
one-dimensional	O
)	O
arrays	O
.	O
</s>
<s>
(	O
Note	O
that	O
zero-based	O
indices	B-Data_Structure
shall	O
be	O
used	O
here	O
.	O
)	O
</s>
<s>
The	O
arrays	O
and	O
are	O
of	O
length	O
,	O
and	O
contain	O
the	O
non-zero	O
values	O
and	O
the	O
column	O
indices	B-Data_Structure
of	O
those	O
values	O
respectively	O
.	O
</s>
<s>
To	O
extract	O
the	O
row	O
1	O
(	O
the	O
second	O
row	O
)	O
of	O
this	O
matrix	B-Architecture
we	O
set	O
row_start	O
=	O
1	O
and	O
row_end	O
=	O
2	O
.	O
</s>
<s>
In	O
this	O
case	O
the	O
CSR	O
representation	O
contains	O
13	O
entries	O
,	O
compared	O
to	O
16	O
in	O
the	O
original	O
matrix	B-Architecture
.	O
</s>
<s>
The	O
CSR	O
format	O
saves	O
on	O
memory	B-General_Concept
only	O
when	O
.	O
</s>
<s>
Moreover	O
,	O
the	O
memory	B-General_Concept
cost	O
of	O
this	O
redundant	O
storage	B-General_Concept
is	O
likely	O
insignificant	O
for	O
a	O
sufficiently	O
large	O
matrix	B-Architecture
.	O
</s>
<s>
The	O
(	O
old	O
and	O
new	O
)	O
Yale	O
sparse	B-Algorithm
matrix	I-Algorithm
formats	O
are	O
instances	O
of	O
the	O
CSR	O
scheme	O
.	O
</s>
<s>
The	O
old	O
Yale	O
format	O
works	O
exactly	O
as	O
described	O
above	O
,	O
with	O
three	O
arrays	O
;	O
the	O
new	O
format	O
combines	O
and	O
into	O
a	O
single	O
array	O
and	O
handles	O
the	O
diagonal	O
of	O
the	O
matrix	B-Architecture
separately	O
.	O
</s>
<s>
It	O
is	O
likely	O
known	O
as	O
the	O
Yale	O
format	O
because	O
it	O
was	O
proposed	O
in	O
the	O
1977	O
Yale	O
Sparse	B-Algorithm
Matrix	I-Algorithm
Package	O
report	O
from	O
Department	O
of	O
Computer	O
Science	O
at	O
Yale	O
University	O
.	O
</s>
<s>
For	O
example	O
,	O
CSC	O
is	O
,	O
where	O
is	O
an	O
array	O
of	O
the	O
(	O
top-to-bottom	O
,	O
then	O
left-to-right	O
)	O
non-zero	O
values	O
of	O
the	O
matrix	B-Architecture
;	O
is	O
the	O
row	O
indices	B-Data_Structure
corresponding	O
to	O
the	O
values	O
;	O
and	O
,	O
is	O
the	O
list	O
of	O
indexes	O
where	O
each	O
column	O
starts	O
.	O
</s>
<s>
The	O
name	O
is	O
based	O
on	O
the	O
fact	O
that	O
column	O
index	O
information	O
is	O
compressed	B-General_Concept
relative	O
to	O
the	O
COO	O
format	O
.	O
</s>
<s>
This	O
format	O
is	O
efficient	O
for	O
arithmetic	O
operations	O
,	O
column	O
slicing	O
,	O
and	O
matrix-vector	O
products	O
.	O
</s>
<s>
This	O
is	O
the	O
traditional	O
format	O
for	O
specifying	O
a	O
sparse	B-Algorithm
matrix	I-Algorithm
in	O
MATLAB	O
(	O
via	O
the	O
function	O
)	O
.	O
</s>
<s>
An	O
important	O
special	O
type	O
of	O
sparse	B-Algorithm
matrices	I-Algorithm
is	O
band	B-Algorithm
matrix	I-Algorithm
,	O
defined	O
as	O
follows	O
.	O
</s>
<s>
The	O
lower	O
bandwidth	B-Algorithm
of	O
a	O
matrix	B-Architecture
is	O
the	O
smallest	O
number	O
such	O
that	O
the	O
entry	O
vanishes	O
whenever	O
.	O
</s>
<s>
Similarly	O
,	O
the	O
upper	O
bandwidth	B-Algorithm
is	O
the	O
smallest	O
number	O
such	O
that	O
whenever	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
tridiagonal	B-Algorithm
matrix	I-Algorithm
has	O
lower	O
bandwidth	B-Algorithm
and	O
upper	O
bandwidth	B-Algorithm
.	O
</s>
<s>
As	O
another	O
example	O
,	O
the	O
following	O
sparse	B-Algorithm
matrix	I-Algorithm
has	O
lower	O
and	O
upper	O
bandwidth	B-Algorithm
both	O
equal	O
to	O
3	O
.	O
</s>
<s>
Matrices	O
with	O
reasonably	O
small	O
upper	O
and	O
lower	O
bandwidth	B-Algorithm
are	O
known	O
as	O
band	O
matrices	O
and	O
often	O
lend	O
themselves	O
to	O
simpler	O
algorithms	O
than	O
general	O
sparse	B-Algorithm
matrices	I-Algorithm
;	O
or	O
one	O
can	O
sometimes	O
apply	O
dense	B-Algorithm
matrix	I-Algorithm
algorithms	O
and	O
gain	O
efficiency	O
simply	O
by	O
looping	O
over	O
a	O
reduced	O
number	O
of	O
indices	B-Data_Structure
.	O
</s>
<s>
By	O
rearranging	O
the	O
rows	O
and	O
columns	O
of	O
a	O
matrix	B-Architecture
it	O
may	O
be	O
possible	O
to	O
obtain	O
a	O
matrix	B-Architecture
with	O
a	O
lower	O
bandwidth	B-Algorithm
.	O
</s>
<s>
A	O
number	O
of	O
algorithms	O
are	O
designed	O
for	O
bandwidth	B-Algorithm
minimization	I-Algorithm
.	O
</s>
<s>
A	O
very	O
efficient	O
structure	O
for	O
an	O
extreme	O
case	O
of	O
band	O
matrices	O
,	O
the	O
diagonal	B-Algorithm
matrix	I-Algorithm
,	O
is	O
to	O
store	O
just	O
the	O
entries	O
in	O
the	O
main	B-Algorithm
diagonal	I-Algorithm
as	O
a	O
one-dimensional	O
array	O
,	O
so	O
a	O
diagonal	B-Algorithm
matrix	I-Algorithm
requires	O
only	O
entries	O
.	O
</s>
<s>
A	O
symmetric	O
sparse	B-Algorithm
matrix	I-Algorithm
arises	O
as	O
the	O
adjacency	B-Algorithm
matrix	I-Algorithm
of	O
an	O
undirected	O
graph	O
;	O
it	O
can	O
be	O
stored	O
efficiently	O
as	O
an	O
adjacency	B-Data_Structure
list	I-Data_Structure
.	O
</s>
<s>
where	O
is	O
a	O
square	O
matrix	B-Architecture
for	O
all	O
.	O
</s>
<s>
The	O
fill-in	O
of	O
a	O
matrix	B-Architecture
are	O
those	O
entries	O
that	O
change	O
from	O
an	O
initial	O
zero	O
to	O
a	O
non-zero	O
value	O
during	O
the	O
execution	O
of	O
an	O
algorithm	O
.	O
</s>
<s>
To	O
reduce	O
the	O
memory	B-General_Concept
requirements	O
and	O
the	O
number	O
of	O
arithmetic	O
operations	O
used	O
during	O
an	O
algorithm	O
,	O
it	O
is	O
useful	O
to	O
minimize	O
the	O
fill-in	O
by	O
switching	O
rows	O
and	O
columns	O
in	O
the	O
matrix	B-Architecture
.	O
</s>
<s>
Both	O
iterative	B-Algorithm
and	O
direct	B-Algorithm
methods	I-Algorithm
exist	O
for	O
sparse	B-Algorithm
matrix	I-Algorithm
solving	O
.	O
</s>
<s>
Iterative	B-Algorithm
methods	I-Algorithm
,	O
such	O
as	O
conjugate	B-Algorithm
gradient	I-Algorithm
method	I-Algorithm
and	O
GMRES	O
utilize	O
fast	O
computations	O
of	O
matrix-vector	O
products	O
,	O
where	O
matrix	B-Architecture
is	O
sparse	O
.	O
</s>
<s>
The	O
use	O
of	O
preconditioners	O
can	O
significantly	O
accelerate	O
convergence	O
of	O
such	O
iterative	B-Algorithm
methods	I-Algorithm
.	O
</s>
<s>
Many	O
software	O
libraries	O
support	O
sparse	B-Algorithm
matrices	I-Algorithm
,	O
and	O
provide	O
solvers	O
for	O
sparse	B-Algorithm
matrix	I-Algorithm
equations	O
.	O
</s>
<s>
,	O
a	O
suite	O
of	O
sparse	B-Algorithm
matrix	I-Algorithm
algorithms	O
,	O
geared	O
toward	O
the	O
direct	O
solution	O
of	O
sparse	O
linear	O
systems	O
.	O
</s>
<s>
PETSc	B-Language
,	O
a	O
large	O
C	O
library	O
,	O
containing	O
many	O
different	O
matrix	B-Architecture
solvers	O
for	O
a	O
variety	O
of	O
matrix	B-Architecture
storage	B-General_Concept
formats	O
.	O
</s>
<s>
Trilinos	B-Language
,	O
a	O
large	O
C++	O
library	O
,	O
with	O
sub-libraries	O
dedicated	O
to	O
the	O
storage	B-General_Concept
of	O
dense	O
and	O
sparse	B-Algorithm
matrices	I-Algorithm
and	O
solution	O
of	O
corresponding	O
linear	O
systems	O
.	O
</s>
<s>
Eigen3	B-Language
is	O
a	O
C++	O
library	O
that	O
contains	O
several	O
sparse	B-Algorithm
matrix	I-Algorithm
solvers	O
.	O
</s>
<s>
However	O
,	O
none	O
of	O
them	O
are	O
parallelized	B-Operating_System
.	O
</s>
<s>
MUMPS	B-Application
(	O
MUltifrontal	O
Massively	O
Parallel	O
sparse	O
direct	O
Solver	O
)	O
,	O
written	O
in	O
Fortran90	O
,	O
is	O
a	O
frontal	B-Application
solver	I-Application
.	O
</s>
<s>
deal.II	B-Language
,	O
a	O
finite	B-Application
element	I-Application
library	O
that	O
also	O
has	O
a	O
sub-library	O
for	O
sparse	O
linear	O
systems	O
and	O
their	O
solution	O
.	O
</s>
<s>
DUNE	O
,	O
another	O
finite	B-Application
element	I-Application
library	O
that	O
also	O
has	O
a	O
sub-library	O
for	O
sparse	O
linear	O
systems	O
and	O
their	O
solution	O
.	O
</s>
<s>
Armadillo	B-Language
provides	O
a	O
user-friendly	O
C++	O
wrapper	O
for	O
BLAS	O
and	O
LAPACK	O
.	O
</s>
<s>
SciPy	B-Application
provides	O
support	O
for	O
several	O
sparse	B-Algorithm
matrix	I-Algorithm
formats	O
,	O
linear	O
algebra	O
,	O
and	O
solvers	O
.	O
</s>
<s>
R	O
and	O
Python	O
package	O
for	O
sparse	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
scikit-learn	B-Application
,	O
a	O
Python	O
library	O
for	O
machine	O
learning	O
,	O
provides	O
support	O
for	O
sparse	B-Algorithm
matrices	I-Algorithm
and	O
solvers	O
.	O
</s>
<s>
implements	O
sparse	B-Algorithm
matrix	I-Algorithm
data	B-General_Concept
structures	I-General_Concept
and	O
linear	O
algebra	O
algorithms	O
in	O
pure	O
Rust	O
.	O
</s>
<s>
supports	O
several	O
sparse	B-Algorithm
matrix	I-Algorithm
formats	O
and	O
linear	O
algebra	O
algorithms	O
with	O
bindings	O
for	O
C	O
,	O
C++	O
,	O
and	O
Fortran	O
.	O
</s>
<s>
The	O
term	O
sparse	B-Algorithm
matrix	I-Algorithm
was	O
possibly	O
coined	O
by	O
Harry	O
Markowitz	O
who	O
initiated	O
some	O
pioneering	O
work	O
but	O
then	O
left	O
the	O
field	O
.	O
</s>
