pub fn usolve<T: Numeric<T>>(u: &Sprs<T>, x: &mut [T])Expand description
Solves an upper triangular system. Solves U*x=b.
Solve Ux=b where x and b are dense. x=b on input, solution on output.
ยงExample:
let u = [
vec![0.7824, 0.4055, 0.0827, 0.9534, 0.9713, 0.1418, 0.0781],
vec![0.0, 0.7766, 0.2981, 0.2307, -0.3172, 0.6819, 0.5979],
vec![0.0, 0.0, 0.2986, -0.5576, 0.5928, -0.2759, -0.1672],
vec![0.0, 0.0, 0.0, 0.6393, -0.4245, 0.1277, 0.5842],
vec![0.0, 0.0, 0.0, 0.0, -1.277, 1.1435, 1.0631],
vec![0.0, 0.0, 0.0, 0.0, 0.0, 1.2096, 0.7268],
vec![0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.4574]
];
let mut u_sparse = rsparse::data::Sprs::new();
u_sparse.from_vec(&u);
let mut b = [
0.189772,
0.055761,
0.030676,
0.181620,
0.526924,
0.744179,
0.078005
];
rsparse::usolve(&u_sparse, &mut b);