yat/utility/univariable/f.h

Code
Comments
Other
Rev Date Author Line
4237 17 Sep 22 peter 1 #ifndef theplu_yat_utility_univariable_f
4237 17 Sep 22 peter 2 #define theplu_yat_utility_univariable_f
4237 17 Sep 22 peter 3
4237 17 Sep 22 peter 4 // $Id$
4237 17 Sep 22 peter 5
4237 17 Sep 22 peter 6 /*
4237 17 Sep 22 peter 7   Copyright (C) 2022 Peter Johansson
4237 17 Sep 22 peter 8
4237 17 Sep 22 peter 9   This file is part of the yat library, https://dev.thep.lu.se/yat
4237 17 Sep 22 peter 10
4237 17 Sep 22 peter 11   The yat library is free software; you can redistribute it and/or
4237 17 Sep 22 peter 12   modify it under the terms of the GNU General Public License as
4237 17 Sep 22 peter 13   published by the Free Software Foundation; either version 3 of the
4237 17 Sep 22 peter 14   License, or (at your option) any later version.
4237 17 Sep 22 peter 15
4237 17 Sep 22 peter 16   The yat library is distributed in the hope that it will be useful,
4237 17 Sep 22 peter 17   but WITHOUT ANY WARRANTY; without even the implied warranty of
4237 17 Sep 22 peter 18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4237 17 Sep 22 peter 19   General Public License for more details.
4237 17 Sep 22 peter 20
4237 17 Sep 22 peter 21   You should have received a copy of the GNU General Public License
4237 17 Sep 22 peter 22   along with yat. If not, see <https://www.gnu.org/licenses/>.
4237 17 Sep 22 peter 23 */
4237 17 Sep 22 peter 24
4237 17 Sep 22 peter 25 namespace theplu {
4237 17 Sep 22 peter 26 namespace yat {
4237 17 Sep 22 peter 27 namespace utility {
4237 17 Sep 22 peter 28
4237 17 Sep 22 peter 29   namespace univariable
4237 17 Sep 22 peter 30   {
4237 17 Sep 22 peter 31     template<class FUNC>
4237 17 Sep 22 peter 32     double f(double x, void* params)
4237 17 Sep 22 peter 33     {
4237 17 Sep 22 peter 34       FUNC* func = static_cast<FUNC*>(params);
4237 17 Sep 22 peter 35       return (*func)(x);
4237 17 Sep 22 peter 36     }
4237 17 Sep 22 peter 37   } // end namespace univariable
4237 17 Sep 22 peter 38
4237 17 Sep 22 peter 39 }}} // end namespaces utility, yat and theplu
4237 17 Sep 22 peter 40 #endif