{"id":18508867,"url":"https://github.com/flaport/umfpack-rs","last_synced_at":"2025-04-09T20:51:04.146Z","repository":{"id":192489956,"uuid":"606625614","full_name":"flaport/umfpack-rs","owner":"flaport","description":"Some UMFPACK bindings for rust.","archived":false,"fork":false,"pushed_at":"2023-11-03T21:52:03.000Z","size":787,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T22:42:25.897Z","etag":null,"topics":["linear","lu","rust","solve","sparse","suitesparse","system","umfpack"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/umfpack-rs","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flaport.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-26T03:36:27.000Z","updated_at":"2023-10-06T09:05:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"aca06a29-a362-4d7e-a230-3c7397c5441b","html_url":"https://github.com/flaport/umfpack-rs","commit_stats":null,"previous_names":["flaport/umfpack-rs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Fumfpack-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Fumfpack-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Fumfpack-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaport%2Fumfpack-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flaport","download_url":"https://codeload.github.com/flaport/umfpack-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111957,"owners_count":21049576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linear","lu","rust","solve","sparse","suitesparse","system","umfpack"],"created_at":"2024-11-06T15:15:40.046Z","updated_at":"2025-04-09T20:51:04.110Z","avatar_url":"https://github.com/flaport.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UMFPACK-rs\n\nSome [UMFPACK](https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev/UMFPACK) bindings for rust.\n\nThe `umfpack-rs` library provides unsafe bindings and safe wrappers to some of the\nSuiteSparse UMFPACK routines. You can use the wrappers to solve a sparse linear system\nthat is either real-values (`f64`) with `umfpack_di_{symbolic,numeric,solve}` or complex\nvalued (`Complex64`) using `umfpack_zi_{symbolic,numeric,solve}`.\n\n## Example\n\n\u003e Note that the rust wrappers attempt to be as close as possible to the SuiteSparse C-code\n\u003e while hiding unsafe operations. This means the exposed API might not be as clean as one\n\u003e might expect.\n\n```rust\n#[allow(non_snake_case)]\nfn main() {\n    use umfpack::prelude::*;\n\n    let n = 5;\n    let Ap = vec![0, 2, 5, 9, 10, 12]; // column pointers of CSC sparse nxn matrix\n    let Ai = vec![0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4]; // row indices of CSC sparse matrix\n    let Ax = vec![2.0, 3.0, 3.0, -1.0, 4.0, 4.0, -3.0, 1.0, 2.0, 2.0, 6.0, 1.0]; // values of CSC sparse matrix\n    let b = vec![8.0, 45.0, -3.0, 3.0, 19.0]; // dense target\n    let mut x = vec![0.0, 0.0, 0.0, 0.0, 0.0]; // initial value for unknown x\n    let control = Control::new(); // default control parameters\n    let mut info = Info::new(); // empty info buffer\n\n    // solving the system Ax=b happens in three steps:\n\n    // 1. Symbolic Analyzation of the sparse system\n    let mut symbolic = Symbolic::new();\n    umfpack_di_symbolic(\n        n, // m\n        n, // n\n        \u0026Ap,\n        \u0026Ai,\n        \u0026Ax,\n        \u0026mut symbolic,\n        Some(\u0026control),\n        Some(\u0026mut info),\n    );\n\n    // 2. Numeric Analyzation of the sparse system\n    let mut numeric = Numeric::new();\n    umfpack_di_numeric(\n        \u0026Ap,\n        \u0026Ai,\n        \u0026Ax,\n        \u0026symbolic,\n        \u0026mut numeric,\n        Some(\u0026control),\n        Some(\u0026mut info),\n    );\n\n    // 3. Solving of the sparse system\n    umfpack_di_solve(\n        UMFPACK::A, // solve the system Ax=b\n        \u0026Ap,\n        \u0026Ai,\n        \u0026Ax,\n        \u0026mut x,\n        \u0026b,\n        \u0026numeric,\n        Some(\u0026control),\n        Some(\u0026mut info),\n    );\n\n    println!(\"symbolic walltime: {}\", info.umfpack_symbolic_walltime());\n    println!(\"numeric walltime: {}\", info.umfpack_numeric_walltime());\n    println!(\"solve walltime: {}\", info.umfpack_solve_walltime());\n\n    for i in 0..(n as usize) {\n        println!(\"x [{}] = {:.1}\", i, x[i]);\n    }\n}\n```\n\n```\nsymbolic walltime: 0.000018095000086759683\nnumeric walltime: 0.0004187900001397793\nsolve walltime: 0.000003099999958067201\nx [0] = 1.0\nx [1] = 2.0\nx [2] = 3.0\nx [3] = 4.0\nx [4] = 5.0\n```\n\nYou can find more examples in the `examples` folder (sometimes alongside with the C++\nequivalent). To learn more on how to use UMFPACK, read the [user guide](./assets/UMFPACK_UserGuide.pdf)\nor [quick start pdf](./assets/UMFPACK_QuickStart.pdf).\n\n## Installation\n\n```bash\ncargo add umfpack-rs\n```\n\n## License \u0026 Credits\n\n© Floris Laporte 2023, LGPL-2.1\n\nThis library vendors, wraps and statically links to [SuiteSparse](https://github.com/DrTimothyAldenDavis/SuiteSparse), LGPL-2.1.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaport%2Fumfpack-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflaport%2Fumfpack-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaport%2Fumfpack-rs/lists"}