From 7b498aec8f1c9afdd4b9925ac5d5719c31e201fa Mon Sep 17 00:00:00 2001 From: kronbichler Date: Wed, 9 Jan 2013 08:29:00 +0000 Subject: [PATCH] Replace x_to_the_dim by Utilities::fixed_power git-svn-id: https://svn.dealii.org/trunk@27993 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/base/tensor_product_polynomials.h | 25 ++---------------- .../base/tensor_product_polynomials_const.h | 26 ++----------------- 2 files changed, 4 insertions(+), 47 deletions(-) diff --git a/deal.II/include/deal.II/base/tensor_product_polynomials.h b/deal.II/include/deal.II/base/tensor_product_polynomials.h index 38dd584d1f..972f0ab0dd 100644 --- a/deal.II/include/deal.II/base/tensor_product_polynomials.h +++ b/deal.II/include/deal.II/base/tensor_product_polynomials.h @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -266,15 +267,6 @@ private: // length arrays void compute_index (const unsigned int i, unsigned int (&indices)[(dim>0?dim:1)]) const; - - /** - * Computes - * xdim for - * unsigned int x. Used in - * the constructor. - */ - static - unsigned int x_to_the_dim (const unsigned int x); }; #ifndef DOXYGEN @@ -521,19 +513,6 @@ TensorProductPolynomials<3>::compute_index(const unsigned int n, /* ---------------- template and inline functions ---------- */ -template -inline -unsigned int -TensorProductPolynomials:: -x_to_the_dim (const unsigned int x) -{ - unsigned int y = 1; - for (int d=0; d template @@ -541,7 +520,7 @@ TensorProductPolynomials:: TensorProductPolynomials(const std::vector &pols) : polynomials (pols.begin(), pols.end()), - n_tensor_pols(x_to_the_dim(pols.size())), + n_tensor_pols(Utilities::fixed_power(pols.size())), index_map(n_tensor_pols), index_map_inverse(n_tensor_pols) { diff --git a/deal.II/include/deal.II/base/tensor_product_polynomials_const.h b/deal.II/include/deal.II/base/tensor_product_polynomials_const.h index aea67d896e..8e3dcbeab5 100644 --- a/deal.II/include/deal.II/base/tensor_product_polynomials_const.h +++ b/deal.II/include/deal.II/base/tensor_product_polynomials_const.h @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -268,15 +269,6 @@ private: // length arrays void compute_index (const unsigned int i, unsigned int (&indices)[(dim>0?dim:1)]) const; - - /** - * Computes - * xdim for - * unsigned int x. Used in - * the constructor. - */ - static - unsigned int x_to_the_dim (const unsigned int x); }; #ifndef DOXYGEN @@ -321,27 +313,13 @@ TensorProductPolynomialsConst<3>::compute_index(const unsigned int n, /* ---------------- template and inline functions ---------- */ -template -inline -unsigned int -TensorProductPolynomialsConst:: -x_to_the_dim (const unsigned int x) -{ - unsigned int y = 1; - for (int d=0; d template TensorProductPolynomialsConst:: TensorProductPolynomialsConst(const std::vector &pols) : polynomials (pols.begin(), pols.end()), - n_tensor_pols(x_to_the_dim(pols.size())+1), + n_tensor_pols(Utilities::fixed_power(pols.size())+1), index_map(n_tensor_pols), index_map_inverse(n_tensor_pols) { -- 2.39.5