codethink
codethink

Reputation: 11

C++ armadillo sparse matrix batch insertion

I am looking at batch insertion for sparse matrices in armadillo in the docs "http://arma.sourceforge.net/docs.html#batch_constructors_sp_mat".

It defines form1 as:

form 1: sp_mat(rowind, colptr, values, n_rows, n_cols)

What does colptr hold? If I understand correctly, it should have the actual address to whatever columns we want to insert at ?

Seems strange to me rowind are not pointers but colptr are pointers. Any reason for this?

Upvotes: 1

Views: 620

Answers (1)

mtall
mtall

Reputation: 3620

Armadillo uses the standard Compressed Sparse Column (CSC) format for storing sparse matrix data. The format is also known as Compressed Column Storage (CCS) and Harwell-Boeing. The row indices and column pointers are explained on several sites:

The CSC format is used for compatibility with existing sparse solvers, etc.

Upvotes: 1

Related Questions