Skip to content

Possible bug in lusolve #437

@josdejong

Description

@josdejong

Someone emailed me with the following case:

var Varr = [
    [ -1, 1, -1, 1 ],
    [ 0, 0, 0, 1 ],
    [ 1, 1, 1, 1 ],
    [ 8, 4, 2, 1 ] 
];

var x = [0.1, 0.2 , 0.15, 0.1];
var y1 = math.lusolve(Varr,x);
var y2 = math.multiply(math.inv(Varr),x);

console.log(math.multiply(Varr,y1)); // [ [ 0.1 ], [ 0.1 ], [ 0.15000000000000002 ], [ 0.2 ] ]
console.log(math.multiply(Varr,y2)); // [ 0.09999999999999998, 0.2, 0.15, 0.1 ]

both log statements should output the values of the original x, but it looks like lusolve is returning a wrong result for y1. I'm not sure if this is a bug or if I'm overlooking something obvious here. @rjbaucells do you have an idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions