GithubHelp home page GithubHelp logo

rwl / amd_order Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 98 KB

Approximate Mimimum Degree ordering in Rust

Home Page: https://crates.io/crates/amd

License: Other

Rust 100.00%
sparse-linear-systems rust

amd_order's People

Contributors

goulart-paul avatar rwl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

goulart-paul

amd_order's Issues

attempt to subtract with overflow error

The following example causes a panic with error 'attempt to subtract with overflow'.

fn main() {

    let n: usize = 35;

    let a_p = vec![
        0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 20, 24, 
        26, 29, 33, 35, 38, 42, 45, 47, 51, 54, 56, 61, 64, 66, 70, 74, 77];

    let a_i = vec![
         0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 15, 1, 15, 16, 
         2, 15, 16, 17, 3, 18, 4, 18, 19, 5, 18, 19, 20, 6, 21, 7, 21, 22, 
         8, 21, 22, 23, 2, 11, 24, 1, 25, 0, 9, 14, 26, 5, 12, 27, 4, 28, 
         3, 9, 10, 14, 29, 8, 13, 30, 7, 31, 6, 10, 14, 32, 11, 12, 
         13, 33, 9, 10, 34];

    let mut p_inv = vec![0; 77];
    let control = amd::Control::default();
    let mut a = [[""; 77]; 77];

    amd::control(&control);

    // This causes a panic
    let (p, p_inv, info) = amd::order::<usize>(n, &a_p, &a_i, &control).unwrap();

    amd::info(&info);
}

The issue appears at this line:

for _knt3 in 0..=lenj - 2 {

I tried to find a smaller example but this was the best I could do. I couldn't put my finger on what it is that causes this issue - it doesn't happen for all matrices and is not obviously related to the dimension.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.