eigen std::vector mapped to Eigen::VectorXd
Eigen::VectorXd b = Eigen::VectorXd::Map (tmp_b.data(), tmp_b.size());// the rbight hand side-vector
eigen出現下面的錯誤是因為Sparse A.size != n*n
Assertion failed: lhs.cols() == rhs.rows() && "invalid matrix product" && "if you wanted a coeff-wise or a dot product use the respective explicit functions", file d:\desktop\redhawkeffect\include\eigen\src/Core/Product.h, line 97
改成A'Ax=A'b即可
eigen -1.#IND代表跑到負無窮大或者有多個解
有多個解的話在邊界加上constrain即可解決(e.g.boundary vector=0)
要注意的點:
1.index別算錯
2.weight的type也要注意(int or double)
沒有留言:
張貼留言