简体   繁体   English

如何使用犰狳获取标准化的拉普拉斯矩阵

[英]How to get normalised laplacian matrix using armadillo

Can anybody please tell me what is the equivalent of the following operation in Armadillo linear algebra package L = D^-0.5 * A * D^-0.5 有人可以告诉我Armadillo线性代数包中以下运算的等效项L = D ^ -0.5 * A * D ^ -0.5

In general how to compute A^n or A^-0.5 in Armadillo where A is a square matrix 通常如何在Armadillo中计算A ^ n或A ^ -0.5,其中A是方矩阵

I can think of one way to do it 我可以想到一种方法

 mat K1,K2;
 K1.load(argv[1],auto_detect);
 colvec c = sum(K1,1);
 mat D = diagmat(c);
 mat D1 = pow(inv(D),0.5);
 mat I(10,10);I.eye();
 mat L = I - D1*K1*D1;

is there any other simpler way ? 还有其他更简单的方法吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM