Assert (coefficients.size()>0, ExcEmptyObject());
return coefficients.size() - 1;
}
+
+
+
+ template <typename number>
+ inline
+ number
+ Polynomial<number>::value (const number x) const
+ {
+ Assert (coefficients.size() > 0, ExcEmptyObject());
+ const unsigned int m=coefficients.size();
+
+ // Horner scheme
+ number value = coefficients.back();
+ for (int k=m-2; k>=0; --k)
+ value = value*x + coefficients[k];
+
+ return value;
+ }
}
DEAL_II_NAMESPACE_CLOSE
- template <typename number>
- number
- Polynomial<number>::value (const number x) const
- {
- Assert (coefficients.size() > 0, ExcEmptyObject());
- const unsigned int m=coefficients.size();
-
- // Horner scheme
- number value = coefficients.back();
- for (int k=m-2; k>=0; --k)
- value = value*x + coefficients[k];
-
- return value;
- }
-
-
-
template <typename number>
void
Polynomial<number>::value (const number x,
/* ------------------- TensorProductPolynomials -------------- */
template <>
+inline
void
TensorProductPolynomials<1>::
compute_index (const unsigned int i,
template <>
+inline
void
TensorProductPolynomials<2>::
compute_index (const unsigned int i,
template <>
+inline
void
TensorProductPolynomials<3>::
compute_index (const unsigned int i,
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams