3

Does Aramadillo have a general purpose equivalent to matlab's bsxfun, which performs element wise operations e.g bsxfun(@minus,A,B)? I have seen that Armadillo does have element wise multiplication and division, but no indication that a generalized function is available.

4

1 回答 1

3

虽然不完全是 bsxfun(),但Armadillo 3.4+ 中添加了两个与您的问题相关的新函数:.each_col()和 .each_row()。它们允许在矩阵的每一列/行上重复给定的向量操作。这包括加法、逐元素乘法等。

于 2012-09-21T09:34:24.310 回答