I want to get a subset of the vector s, the following code didn't give the right result. But if I write
VectorXd e=s.head(svp)
e is right. Why the following code is wrong? Thanks!
Eigen::JacobiSVD<Eigen::MatrixXd> svd(input, Eigen::ComputeThinU |
Eigen::ComputeThinV);
VectorXd s=svd.singularValues();
int svp=5;
s=s.head(svp); //Wrong!