c++
Iris_wondering
CS PhD 在读
展开
-
Eigen sort
Eigen::ArrayXd sort_vec(Eigen::ArrayXXd & arr, ArrayXd & sorted_arr){ Eigen::ArrayXd ind=ArrayXd::LinSpaced(arr.size(), 0, arr.size()-1); auto rule=[arr](int i, int j) -> bool{return arr(i)>arr(j);}; std::sort(ind.data(), ind.data()+ind.s原创 2021-07-05 01:13:23 · 362 阅读 · 0 评论 -
Eigen arctan2
Refhttps://forum.kde.org/viewtopic.php?t=112142Code#include <iostream>#include <Eigen/Dense>using namespace Eigen;double my_atan2(double a, double b) { return std::atan2(a,b); }int main(){ Matrix4d A, B, C; C = A.binaryExpr(B, std原创 2021-07-04 11:59:20 · 1347 阅读 · 0 评论