yat/regression/KernelTriCube.cc

Code
Comments
Other
Rev Date Author Line
281 20 Apr 05 peter 1 // $Id$
281 20 Apr 05 peter 2
675 10 Oct 06 jari 3 /*
831 27 Mar 07 peter 4   Copyright (C) 2005 Peter Johansson
2119 12 Dec 09 peter 5   Copyright (C) 2006 Jari Häkkinen
4359 23 Aug 23 peter 6   Copyright (C) 2007 Peter Johansson
4359 23 Aug 23 peter 7   Copyright (C) 2008 Jari Häkkinen, Peter Johansson
2919 19 Dec 12 peter 8   Copyright (C) 2012 Peter Johansson
281 20 Apr 05 peter 9
1437 25 Aug 08 peter 10   This file is part of the yat library, http://dev.thep.lu.se/yat
675 10 Oct 06 jari 11
675 10 Oct 06 jari 12   The yat library is free software; you can redistribute it and/or
675 10 Oct 06 jari 13   modify it under the terms of the GNU General Public License as
1486 09 Sep 08 jari 14   published by the Free Software Foundation; either version 3 of the
675 10 Oct 06 jari 15   License, or (at your option) any later version.
675 10 Oct 06 jari 16
675 10 Oct 06 jari 17   The yat library is distributed in the hope that it will be useful,
675 10 Oct 06 jari 18   but WITHOUT ANY WARRANTY; without even the implied warranty of
675 10 Oct 06 jari 19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
675 10 Oct 06 jari 20   General Public License for more details.
675 10 Oct 06 jari 21
675 10 Oct 06 jari 22   You should have received a copy of the GNU General Public License
1487 10 Sep 08 jari 23   along with yat. If not, see <http://www.gnu.org/licenses/>.
675 10 Oct 06 jari 24 */
675 10 Oct 06 jari 25
2881 18 Nov 12 peter 26 #include <config.h>
2881 18 Nov 12 peter 27
680 11 Oct 06 jari 28 #include "KernelTriCube.h"
680 11 Oct 06 jari 29 #include "Kernel.h"
675 10 Oct 06 jari 30
281 20 Apr 05 peter 31 #include <cmath>
281 20 Apr 05 peter 32
281 20 Apr 05 peter 33 namespace theplu {
680 11 Oct 06 jari 34 namespace yat {
389 15 Aug 05 peter 35 namespace regression {
281 20 Apr 05 peter 36
295 29 Apr 05 peter 37   KernelTriCube::KernelTriCube(void)
295 29 Apr 05 peter 38     : Kernel()
281 20 Apr 05 peter 39   {
281 20 Apr 05 peter 40   }
281 20 Apr 05 peter 41
767 22 Feb 07 peter 42   double KernelTriCube::operator()(const double x) const
281 20 Apr 05 peter 43   {
281 20 Apr 05 peter 44     if (x>1 || x<-1)
281 20 Apr 05 peter 45       return 0.0;
281 20 Apr 05 peter 46     else
1683 30 Dec 08 peter 47       return pow(1-pow(std::abs(x),3),3);
281 20 Apr 05 peter 48   }
281 20 Apr 05 peter 49
681 11 Oct 06 jari 50 }}} // of namespaces regression, yat, and theplu