From 02ab8ea1d86fe2803e6ca4e96ed0567f758e9ff3 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Tue, 17 Mar 2020 23:50:57 -0400 Subject: [PATCH] bug fix for back_substitute that breaks underdetermined solves in linear_solve with matrix RHS. --- math.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math.scad b/math.scad index 3cd7702..4dfe845 100644 --- a/math.scad +++ b/math.scad @@ -646,7 +646,7 @@ function back_substitute(R, b, x=[],transpose = false) = assert(is_matrix(R, square=true)) let(n=len(R)) assert(is_vector(b,n) || is_matrix(b,n),"R and b are not compatible in back_substitute") - !is_vector(b) ? transpose([for(i=[0:len(b[0])-1]) back_substitute(R,subindex(b,i))]) : + !is_vector(b) ? transpose([for(i=[0:len(b[0])-1]) back_substitute(R,subindex(b,i),transpose=transpose)]) : transpose? reverse(back_substitute( [for(i=[0:n-1]) [for(j=[0:n-1]) R[n-1-j][n-1-i]]],