动态矩阵的逐元素平方根反比

问题描述 投票:0回答:0

有没有一种方法可以在动态大小的矩阵上使用代数 glm 方法 目的是找到 X 使得 X†SX = I:当前方法是 X=Us^{-1/2}U† 其中 S=UsU†:

// in general these will be dynamically sized and read from a file
let N = 2;
let S = DMatrix::from_row_slice(N,N, &[1.0, 0.5017, 0.5017, 1.0]);
// S will always be symmetric
let decomp = SymmetricEigen::new(S);
let eigvals = decomp.eigenvalues;
// this is the code that does not work
let s = glm::inversesqrt(&eigvals);
rust matrix-inverse nalgebra
© www.soinside.com 2019 - 2024. All rights reserved.