Suppose I have a matrix A which is n x n matrix and I have a vector b which is n x 1 vector and I want to calculate the following implementation in Eigen library.
bsxfun(@rdivide, A, b) How can I apply it Eigen ?
Suppose I have a matrix A which is n x n matrix and I have a vector b which is n x 1 vector and I want to calculate the following implementation in Eigen library.
bsxfun(@rdivide, A, b) How can I apply it Eigen ?
How about this one:
Eigen::MatrixXf A(n,n); Eigen::VectorXf b(n); A.cwiseQuotient( b.replicate(1,A.cols()) ) Here is one without replication, equivalent to bsxfun in MATLAB:
A.array().colwise() / b.array()