# source:trunk/yat/regression/KernelTriCube.cc@1157

Last change on this file since 1157 was 1000, checked in by Jari Häkkinen, 14 years ago

trac moved to new location.

• Property svn:eol-style set to `native`
• Property svn:keywords set to `Id`
File size: 1.2 KB
RevLine
[281]1// \$Id: KernelTriCube.cc 1000 2007-12-23 20:09:15Z jari \$
2
[675]3/*
[831]4  Copyright (C) 2005 Peter Johansson
5  Copyright (C) 2006 Jari Häkkinen
6  Copyright (C) 2007 Peter Johansson
[281]7
[1000]8  This file is part of the yat library, http://trac.thep.lu.se/yat
[675]9
10  The yat library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License as
12  published by the Free Software Foundation; either version 2 of the
14
15  The yat library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23  02111-1307, USA.
24*/
25
[680]26#include "KernelTriCube.h"
27#include "Kernel.h"
[675]28
[281]29#include <cmath>
30
31namespace theplu {
[680]32namespace yat {
[389]33namespace regression {
[281]34
[295]35  KernelTriCube::KernelTriCube(void)
36    : Kernel()
[281]37  {
38  }
39
[767]40  double KernelTriCube::operator()(const double x) const
[281]41  {
42    if (x>1 || x<-1)
43      return 0.0;
44    else
[282]45      return pow(1-pow(fabs(x),3),3);
[281]46  }
47
[681]48}}} // of namespaces regression, yat, and theplu
Note: See TracBrowser for help on using the repository browser.