![]() |
GURLS++
2.0.00
C++ Implementation of GURLS Matlab Toolbox
|
00001 /* 00002 * The GURLS Package in C++ 00003 * 00004 * Copyright (C) 2011-1013, IIT@MIT Lab 00005 * All rights reserved. 00006 * 00007 * author: M. Santoro 00008 * email: msantoro@mit.edu 00009 * website: http://cbcl.mit.edu/IIT@MIT/IIT@MIT.html 00010 * 00011 * Redistribution and use in source and binary forms, with or without 00012 * modification, are permitted provided that the following conditions 00013 * are met: 00014 * 00015 * * Redistributions of source code must retain the above 00016 * copyright notice, this list of conditions and the following 00017 * disclaimer. 00018 * * Redistributions in binary form must reproduce the above 00019 * copyright notice, this list of conditions and the following 00020 * disclaimer in the documentation and/or other materials 00021 * provided with the distribution. 00022 * * Neither the name(s) of the copyright holders nor the names 00023 * of its contributors or of the Massacusetts Institute of 00024 * Technology or of the Italian Institute of Technology may be 00025 * used to endorse or promote products derived from this software 00026 * without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00029 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00030 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00031 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00032 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00033 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00034 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00035 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00036 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00037 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00038 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00039 * POSSIBILITY OF SUCH DAMAGE. 00040 */ 00041 00042 #ifndef GURLS_ICHOLWRAPPER_H 00043 #define GURLS_ICHOLWRAPPER_H 00044 00045 #include "gurls++/wrapper.h" 00046 00047 namespace gurls 00048 { 00049 00050 template<typename T> 00051 class ICholWrapper: public GurlsWrapper<T> 00052 { 00053 public: 00059 ICholWrapper(const std::string& name); 00060 00067 void train(const gMat2D<T> &X, const gMat2D<T> &y); 00068 00075 void update(const gVec<T> &X, const gVec<T> &y); 00076 00083 gMat2D<T>* eval(const gMat2D<T> &X); 00084 00085 gMat2D<T>* eval_ls(const gMat2D<T> &X); 00086 00087 using GurlsWrapper<T>::eval; 00088 00089 void setRankMax(unsigned long rank); 00090 void setNRank(unsigned long n_rank); 00091 void setSigma(double sigma); 00092 void setXva(const gMat2D<T>& Xva); 00093 void setyva(const gMat2D<T>& yva); 00094 00095 00096 00097 protected: 00098 T* computeNewKcol( const T* Xtr, const unsigned long xr, const unsigned long xc, 00099 const double sigma, 00100 const unsigned long* pVec, 00101 const unsigned long start, const unsigned long n); 00102 00103 }; 00104 00105 } 00106 00107 #include "icholwrapper.hpp" 00108 00109 #endif //GURLS_ICHOLWRAPPER_H