cr.sparse.dict.sparse_binary_mtx

cr.sparse.dict.sparse_binary_mtx(key, M, N, d, normalize_atoms=True, dense=False)[source]

A sensing matrix where exactly d entries are 1 in each column

Parameters
  • key – a PRNG key used as the random key.

  • M (int) – Number of rows of the sensing matrix

  • N (int) – Number of columns of the sensing matrix

  • d (int) – Number of 1s in each column

  • normalize_atoms (bool) – Whether the columns of sensing matrix are normalized (default True)

  • dense (bool) – Whether to return a dense or a sparse matrix

Returns

A sparse binary matrix where each column contains exactly d ones and (M-d) zeros.

Return type

(jax.experimental.sparse.bcoo.BCOO)

Note

The resultant matrix is stored in the BCOO format.