diff --git a/src/libPMacc/include/algorithms/math/defines/trigo.hpp b/src/libPMacc/include/algorithms/math/defines/trigo.hpp index 3885c7f082..15059203fd 100644 --- a/src/libPMacc/include/algorithms/math/defines/trigo.hpp +++ b/src/libPMacc/include/algorithms/math/defines/trigo.hpp @@ -1,24 +1,24 @@ /** - * Copyright 2013-2014 Heiko Burau, Rene Widera, Richard Pausch + * Copyright 2013-2014 Heiko Burau, Rene Widera, Richard Pausch, Axel Huebl * - * This file is part of libPMacc. - * - * libPMacc is free software: you can redistribute it and/or modify - * it under the terms of of either the GNU General Public License or - * the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * libPMacc is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with libPMacc. - * If not, see . - */ - + * This file is part of libPMacc. + * + * libPMacc is free software: you can redistribute it and/or modify + * it under the terms of of either the GNU General Public License or + * the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libPMacc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with libPMacc. + * If not, see . + */ #pragma once @@ -36,6 +36,9 @@ struct Sin; template struct Cos; +template +struct Tan; + template struct SinCos; @@ -44,29 +47,45 @@ struct Sinc; template -HDINLINE static typename Sin< T1 >::result sin(const T1& value) +HDINLINE static +typename Sin< T1 >::result +sin(const T1& value) { return Sin< T1 > ()(value); } template -HDINLINE static typename Cos::result cos(const T1& value) +HDINLINE static +typename Cos::result +cos(const T1& value) { return Cos< T1 > ()(value); } +template +HDINLINE static +typename Tan::result +tan(const T1& value) +{ + return Tan< T1 > ()(value); +} + template -HDINLINE static typename SinCos< ArgType, SinType, CosType >::result sincos(ArgType arg, SinType& sinValue, CosType& cosValue) +HDINLINE static +typename SinCos< ArgType, SinType, CosType >::result +sincos(ArgType arg, SinType& sinValue, CosType& cosValue) { return SinCos< ArgType, SinType, CosType > ()(arg, sinValue, cosValue); } template -HDINLINE static typename Sinc::result sinc(const T1& value) +HDINLINE static +typename Sinc::result +sinc(const T1& value) { return Sinc< T1 > ()(value); } -} //namespace math -} //namespace algorithms -}//namespace PMacc +} /* namespace math */ +} /* namespace algorithms */ +} /* namespace PMacc */ diff --git a/src/libPMacc/include/algorithms/math/doubleMath/trigo.tpp b/src/libPMacc/include/algorithms/math/doubleMath/trigo.tpp index 48813793f9..d0b2704685 100644 --- a/src/libPMacc/include/algorithms/math/doubleMath/trigo.tpp +++ b/src/libPMacc/include/algorithms/math/doubleMath/trigo.tpp @@ -1,24 +1,24 @@ /** - * Copyright 2013-2014 Heiko Burau, Rene Widera, Richard Pausch + * Copyright 2013-2014 Heiko Burau, Rene Widera, Richard Pausch, Axel Huebl * - * This file is part of libPMacc. - * - * libPMacc is free software: you can redistribute it and/or modify - * it under the terms of of either the GNU General Public License or - * the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * libPMacc is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with libPMacc. - * If not, see . - */ - + * This file is part of libPMacc. + * + * libPMacc is free software: you can redistribute it and/or modify + * it under the terms of of either the GNU General Public License or + * the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libPMacc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with libPMacc. + * If not, see . + */ #pragma once @@ -54,6 +54,17 @@ struct Cos } }; +template<> +struct Tan +{ + typedef double result; + + HDINLINE double operator( )(const double& value ) + { + return ::tan( value ); + } +}; + template<> struct SinCos { diff --git a/src/libPMacc/include/algorithms/math/floatMath/trigo.tpp b/src/libPMacc/include/algorithms/math/floatMath/trigo.tpp index 0d75722d53..994dd22f87 100644 --- a/src/libPMacc/include/algorithms/math/floatMath/trigo.tpp +++ b/src/libPMacc/include/algorithms/math/floatMath/trigo.tpp @@ -1,24 +1,25 @@ /** - * Copyright 2013-2014 Heiko Burau, Rene Widera, Richard Pausch + * Copyright 2013-2014 Heiko Burau, Rene Widera, Richard Pausch, Axel Huebl * - * This file is part of libPMacc. - * - * libPMacc is free software: you can redistribute it and/or modify - * it under the terms of of either the GNU General Public License or - * the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * libPMacc is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with libPMacc. - * If not, see . - */ - + * This file is part of libPMacc. + * + * libPMacc is free software: you can redistribute it and/or modify + * it under the terms of of either the GNU General Public License or + * the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libPMacc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with libPMacc. + * If not, see . + */ + #pragma once #include "types.h" @@ -53,6 +54,17 @@ struct Cos } }; +template<> +struct Tan +{ + typedef float result; + + HDINLINE float operator( )(const float& value ) + { + return ::tanf( value ); + } +}; + template<> struct SinCos {