Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I am currently dealing with really huge (~ 80,000 x 80,000) sparse matrices. I this context I need to read the number of non-default values in each row.

When Accessing the i-th row of a SparseArray, this information is given.

E.g.

test = SparseArray[{{1, 1} -> 3, {1, 5} -> 2, {5, 3} -> 1}];

test[[1]]

returns SparseArray[<2>, {5}]

However, I fail to access the number of entries (here 2) to assign it to a variable.

I did not find any information in the documentation so far.

Does anyone have an idea?

Thx

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica SparseArray Access Non-Default Values

Loading...

Similar Threads - Mathematica SparseArray Access | Date |
---|---|

Mathematica Cannot do the integral of the Hyper-geometric function? | Mar 11, 2018 |

Mathematica Cannot Plot This Function in Mathematica | Feb 26, 2018 |

Mathematica While Loop in Mathematica | Feb 25, 2018 |

Mathematica Mathematica Real Part | Feb 24, 2018 |

Matlab fails to access a list of variables | Jun 30, 2013 |

**Physics Forums - The Fusion of Science and Community**