Registered Member
|
Hello
I have a problem implementing a mcl algorithm with Eigen SparseMatrix<float>. The documentation states that there is a cwisePow() function, but in fact there is none. I want to implement a <matlab> m2 = m .^ p; <matlab> function but got lost with power function. can someone help me pls? Thx in advance Peter |
Moderator
|
There is indeed no cwisePow, nor .array().pow(exponent) for sparse objects. In the meantime:
mat2 = mat.unaryExpr(Eigen::internal::scalar_pow_op<float>(p)); |
Registered Member
|
Thank you for the info big help.
i have a nother question there is a normalization problem, and the MatrixXf has a normalize function, but SparseMatrix has none. dinv = diag(1./sum(m2)) m2 = m2 * dinv; This is my matlab code. Could you help me pls? Thx |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]