Returns the LU solve of the linear system $Ax = b$.

tch_btrisolve(x, LU_data, LU_pivots)

Arguments

x

tensor object

LU_data

the pivoted LU factorization of A from tch_btrifact()

LU_pivots

the pivots of the LU factorization

Examples

A <- tensor(array(runif(18), dim = c(2,3,3))) b <- tensor(matrix(runif(6), ncol = 3)) A_LU <- tch_btrifact(A) tch_btrisolve(b, A_LU[[1]], A_LU[[2]])
#> tensor #> -0.5869 -0.2264 1.9965 #> 0.1394 1.0963 -3.7880 #> [ Variable[CPUFloatType]{2,3} ]