34 using Eigen::VectorXd;
42 phi.resize(x.size(), _order + 1);
74 double p1 = xk -
a[0];
77 double p2 = std::numeric_limits<double>::quiet_NaN();
78 for (
int i = 1; i < power; ++i)
80 p2 = (xk - a[i]) * p1 -
b[i - 1] * p0;
95 for (
int i = 0; i < n; ++i)
101 for (
int i = 1; i <
order; ++i)
103 double sum0, sum1, sum2;
104 sum0 = sum1 = sum2 = 0.0;
105 for (
int j = 0; j < n; ++j)
111 sum2 += x[j] * tmp1 * tmp1;
114 b[i - 1] = sum1 / sum0;
123 for (
int i = 0; i <
order + 1; ++i)
125 for (
int j = 0; j < x.size(); ++j)
134 VectorXd tmp = (
phi.transpose() *
phi).diagonal();
135 for (
int i = 0; i < tmp.rows(); ++i)
136 tmp(i) = 1. / tmp(i);
orthoPoly1D & operator=(const orthoPoly1D &op)
void ComputeAB(const std::vector< double > &x)
void EvaluateOrthogonals(const std::vector< double > &x)
void ComputePhiTPhiInv(const std::vector< double > &x)
double EvaluateOrthogonal(int power, double xk) const
Eigen::MatrixXd phiTphiInv