* @param q number of points.
* @return vector containing nodes.
*/
- std::vector<double> compute_quadrature_points(const unsigned int q,
- const int alpha,
- const int beta) const;
+ std::vector<double>
+ compute_quadrature_points (const unsigned int q,
+ const int alpha,
+ const int beta) const;
/**
* Compute Legendre-Gauss-Lobatto quadrature
* @param x quadrature points.
* @return vector containing weights.
*/
- std::vector<double> compute_quadrature_weights(std::vector<double>& x,
- const int alpha,
- const int beta) const;
+ std::vector<double>
+ compute_quadrature_weights (const std::vector<double> &x,
+ const int alpha,
+ const int beta) const;
/**
* Evaluate a Jacobi polynomial
compute_quadrature_points(const unsigned int, const int, const int) const;
template <>
std::vector<double> QGaussLobatto<1>::
-compute_quadrature_weights(std::vector<double>&, const int, const int) const;
+compute_quadrature_weights(const std::vector<double>&, const int, const int) const;
template <>
double QGaussLobatto<1>::
JacobiP(const double, const int, const int, const unsigned int) const;
template <>
std::vector<double> QGaussLobatto<1>::
-compute_quadrature_weights(std::vector<double>& x,
+compute_quadrature_weights(const std::vector<double> &x,
const int alpha,
const int beta) const
{
std::vector<double> w(q);
double s = 0;
- double factor = std::pow(2., alpha+beta+1)*gamma(alpha+q)*gamma(beta+q)/
- ((q-1)*gamma(q)*gamma(alpha+beta+q+1));
+ const double factor = std::pow(2., alpha+beta+1) *
+ gamma(alpha+q) *
+ gamma(beta+q) /
+ ((q-1)*gamma(q)*gamma(alpha+beta+q+1));
for (unsigned int i=0; i<q; ++i)
{
s = JacobiP(x[i], alpha, beta, q-1);