1 #ifndef NPSTAT_OPSROOTSFROMJACOBIMATRIX_HH_
2 #define NPSTAT_OPSROOTSFROMJACOBIMATRIX_HH_
26 const OPS& ops,
const unsigned degree)
28 std::vector<double> roots(degree);
31 if (degree > ops.maxDegree())
throw std::invalid_argument(
32 "In npstat::opsRootsFromJacobiMatrix: "
33 "degree argument is out of range");
35 assert(jacobiMat.
nRows() == degree);
36 assert(jacobiMat.nColumns() == degree);
38 roots[0] = jacobiMat[0][0];
41 const double s = ops.scale();
42 const double shift = ops.location();
43 if (!(shift == 0.0 && s == 1.0))
44 for (
unsigned i=0; i<degree; ++i)
45 roots[i] = roots[i]*s + shift;
46 std::sort(roots.begin(), roots.end());
unsigned nRows() const
Definition: Matrix.hh:155
void tdSymEigen(Numeric *eigenvalues, unsigned lenEigenvalues, Matrix *eigenvectors=0, EigenMethod m=EIGEN_RRR) const
Definition: AbsArrayProjector.hh:14
std::vector< double > opsRootsFromJacobiMatrix(const OPS &ops, const unsigned degree)
Definition: opsRootsFromJacobiMatrix.hh:25