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?
Someone emailed me with the following case:
both log statements should output the values of the original
x, but it looks likelusolveis 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?