C ++ Armadillo: - equivalent to Matlab bsxfun

Does Aramadillo have a common meaning equivalent to matlab bsxfun, which performs elementary operations, for example bsxfun (@ minus, A, B)? I saw that Armadillo has elementary multiplication and division, but there is no indication that there is a generalized function.

+3
source share
1 answer

While not exactly bsxfun (), added two new features added to the Armadillo 3.4+, which relate to your question: . each_col () and .each_row (). They allow you to repeat a given vector operation in each column / row of the matrix. This includes adding, multiplying by elements, etc.

+3
source

All Articles