// $Id: KernelTriCube.cc 1000 2007-12-23 20:09:15Z jari $ /* Copyright (C) 2005 Peter Johansson Copyright (C) 2006 Jari Häkkinen Copyright (C) 2007 Peter Johansson This file is part of the yat library, http://trac.thep.lu.se/yat The yat library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The yat library 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 for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "KernelTriCube.h" #include "Kernel.h" #include namespace theplu { namespace yat { namespace regression { KernelTriCube::KernelTriCube(void) : Kernel() { } double KernelTriCube::operator()(const double x) const { if (x>1 || x<-1) return 0.0; else return pow(1-pow(fabs(x),3),3); } }}} // of namespaces regression, yat, and theplu