pub fn triangular_solve_matrix<T>(
a: &Matrix<T>,
b: &Matrix<T>,
left_side: bool,
lower: bool,
transpose_a: bool,
unit_diagonal: bool,
) -> Result<Matrix<T>, BackendLinalgError>where
T: MatrixTriangularSolveScalar,Expand description
Solve a triangular system for column-major Matrix values.
If left_side is true, this solves op(A) X = B; otherwise it solves
X op(A) = B. lower selects the triangular half, transpose_a applies
a transpose to A, and unit_diagonal treats the diagonal of A as ones.
§Errors
Returns an error when the input shapes or scalar dtype are invalid (a /// shape or dtype mismatch), the triangular flags are invalid (an /// invalid-configuration failure), or the solve fails (a backend or singular /// failure).
§Examples
use tensor4all_tensorbackend::{from_vec2d, triangular_solve_matrix};
let a = from_vec2d(vec![vec![2.0_f64, 1.0], vec![0.0, 3.0]]);
let b = from_vec2d(vec![vec![2.0_f64, 7.0]]);
let x = triangular_solve_matrix(&a, &b, false, false, false, false).unwrap();
assert!((x[[0, 0]] - 1.0).abs() < 1.0e-12);
assert!((x[[0, 1]] - 2.0).abs() < 1.0e-12);