Armadillo大规模矩阵处理 矩阵中每一个元素开方处理

问题遇到的现象和发生背景

Armadillo大规模矩阵处理
矩阵中每一个元素开方处理

问题相关代码,请勿粘贴截图

double SoilAnalyse::Mq(double x1, double y1, double x2, double y2, double c)
{
return sqrt(pow((x1 - x2), 2) + pow((y1 - y2), 2) + pow(c, 2));
}

for (int i = 0; i < Lxtest.size(); i++) {
for (int j = 0; j < Lx.size(); j++) {
ATest(i, j) = Mq(Lxtest(i, 0), Lytest(i, 0), Lx(j, 0), Ly(j, 0), g_interpolation);
}
}

矩阵依次遍历有些蠢,想直接对中每个元素开方处理,求方法