You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'd like to use your code for an application in recommender systems, which currently computes colamd through cholmod using a Python wrapper (https://scikit-sparse.readthedocs.io/en/latest/) - and I would like to get rid of this dependency and use your code instead. However, I stumbled upon several cases where the algorithm panics on valid input. Could you help me solve it? 🙂
Disclaimer: I'm very new to Rust and can't debug this on my own. It's possible I made a mistake somewhere in my Rust code, please be patient.
Problem
colamd panics on valid input -- symbolic sparse matrix, even a small one.
I created 3 small test cases:
Matrix 100 is a 100x100 submatrix of matrix 101. 101 is a 101x101 submatrix of matrix 120. Matrix 120 has shape 120x120, and is a submatrix of a large sparse matrix (see section Data)
colamd runs fine for matrix 100
panics for matrices 101 and 120 (see console outputs)
How to run
recreate the folder structure, put data in correct folders (see File structure)
from project root (rust_colamd), run cargo build
cargo run
To see outputs for matrix 101, uncomment the line in main()
Console outputs
100x100 matrix
Reading data/100/shape.txt
Reading data/100/indices.txt
Reading data/100/indptr.txt
Matrix stats:
n rows: 100
n cols: 100
indptr range: 0 - 1302
indices range: 0 - 99
nnz: 1302
recommended length: 2964
time elapsed (data preparation): 0 ms
Running colamd with arguments:
n_row 100
n_col 100
a_len 2964
len(a_i) 2964
len(p) 101
colamd result: true
time elapsed (colamd): 0 ms
101x101 matrix
Reading data/101/shape.txt
Reading data/101/indices.txt
Reading data/101/indptr.txt
Matrix stats:
n rows: 101
n cols: 101
indptr range: 0 - 1315
indices range: 0 - 100
nnz: 1315
recommended length: 2994
time elapsed (data preparation): 0 ms
Running colamd with arguments:
n_row 101
n_col 101
a_len 2994
len(a_i) 2994
len(p) 102
thread 'main' panicked at /Users/masp/.cargo/registry/src/index.crates.io-6f17d22bba15001f/colamd-0.1.0/src/col.rs:134:17:
called `ColShared3::prev()` on a `HeadHash` value: -1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
120x120 matrix
Reading data/120/shape.txt
Reading data/120/indices.txt
Reading data/120/indptr.txt
Matrix stats:
n rows: 120
n cols: 120
indptr range: 0 - 1731
indices range: 0 - 119
nnz: 1731
recommended length: 3928
time elapsed (data preparation): 0 ms
Running colamd with arguments:
n_row 120
n_col 120
a_len 3928
len(a_i) 3928
len(p) 121
thread 'main' panicked at /Users/masp/.cargo/registry/src/index.crates.io-6f17d22bba15001f/colamd-0.1.0/src/col.rs:134:17:
called `ColShared3::prev()` on a `HeadHash` value: 3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Hi,
thank you for your response. For the purposes of my project I wrote simple Python bindings for the official C implementation of COLAMD, and it's working fine even on inputs where the Rust code panics. Consequently, the bug is most likely in the translation.
Hello, I'd like to use your code for an application in recommender systems, which currently computes
colamd
throughcholmod
using a Python wrapper (https://scikit-sparse.readthedocs.io/en/latest/) - and I would like to get rid of this dependency and use your code instead. However, I stumbled upon several cases where the algorithm panics on valid input. Could you help me solve it? 🙂Disclaimer: I'm very new to Rust and can't debug this on my own. It's possible I made a mistake somewhere in my Rust code, please be patient.
Problem
colamd
panics on valid input -- symbolic sparse matrix, even a small one.I created 3 small test cases:
100
is a 100x100 submatrix of matrix101
.101
is a 101x101 submatrix of matrix120
. Matrix120
has shape 120x120, and is a submatrix of a large sparse matrix (see section Data)colamd
runs fine for matrix100
101
and120
(see console outputs)How to run
rust_colamd
), runcargo build
cargo run
To see outputs for matrix
101
, uncomment the line inmain()
Console outputs
100x100 matrix
101x101 matrix
120x120 matrix
Reproducing the issue
Rust version
File structure
Data
ratings.csv
in this dataset)Running
colamd
on the full matrix also panics, that's how I initially found out, but I created some smaller submatrices to demonstrate the issue.Cargo.toml
main.rs
The text was updated successfully, but these errors were encountered: