Skip to main content

MatrixTriangularSolveScalar

Trait MatrixTriangularSolveScalar 

Source
pub trait MatrixTriangularSolveScalar: BackendLinalgScalar + MatrixScalar { }
Expand description

Scalar types supported by triangular_solve_matrix. f64 and Complex64 are solved directly. f32 and Complex32 are promoted to the corresponding 64-bit dtype for the backend solve and then converted back, because the current tenferro CPU triangular solve is double precision only.

§Examples

use tensor4all_tensorbackend::{from_vec2d, triangular_solve_matrix};
let a = from_vec2d(vec![vec![2.0_f64, 0.0], vec![1.0, 3.0]]);
let b = from_vec2d(vec![vec![2.0_f64], vec![7.0]]);
let x = triangular_solve_matrix(&a, &b, true, true, false, false).unwrap();
assert!((x[[0, 0]] - 1.0).abs() < 1.0e-12);
assert!((x[[1, 0]] - 2.0).abs() < 1.0e-12);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl MatrixTriangularSolveScalar for Complex32

Source§

impl MatrixTriangularSolveScalar for Complex64

Source§

impl MatrixTriangularSolveScalar for f32

Source§

impl MatrixTriangularSolveScalar for f64

Implementors§