|
SHOGUN v0.9.3
|
00001 /*----------------------------------------------------------------------- 00002 * 00003 * This program is free software; you can redistribute it and/or modify 00004 * it under the terms of the GNU General Public License as published by 00005 * the Free Software Foundation; either version 3 of the License, or 00006 * (at your option) any later version. 00007 * 00008 * Library of solvers for Generalized Nearest Point Problem (GNPP). 00009 * 00010 * Written (W) 1999-2008 Vojtech Franc, xfrancv@cmp.felk.cvut.cz 00011 * Copyright (C) 1999-2008 Center for Machine Perception, CTU FEL Prague 00012 * 00013 -------------------------------------------------------------------- */ 00014 00015 #ifndef GMNPLIB_H__ 00016 #define GMNPLIB_H__ 00017 00018 #include <math.h> 00019 #include <limits.h> 00020 00021 #include "base/SGObject.h" 00022 #include "lib/io.h" 00023 #include "lib/common.h" 00024 #include "kernel/Kernel.h" 00025 00026 namespace shogun 00027 { 00066 class CGMNPLib: public CSGObject 00067 { 00068 public: 00078 CGMNPLib( 00079 float64_t* vector_y, CKernel* kernel, int32_t num_data, 00080 int32_t num_virtual_data, int32_t num_classes, float64_t reg_const); 00081 00082 virtual ~CGMNPLib(); 00083 00093 int8_t gmnp_imdm(float64_t *vector_c, 00094 int32_t dim, 00095 int32_t tmax, 00096 float64_t tolabs, 00097 float64_t tolrel, 00098 float64_t th, 00099 float64_t *alpha, 00100 int32_t *ptr_t, 00101 float64_t **ptr_History, 00102 int32_t verb); 00103 00110 void get_indices2( int32_t *index, int32_t *c, int32_t i ); 00111 00112 protected: 00118 float64_t *get_kernel_col( int32_t a ); 00119 00126 float64_t* get_col( int32_t a, int32_t b ); 00127 00134 float64_t kernel_fce( int32_t a, int32_t b ); 00135 00137 inline virtual const char* get_name() const { return "GMNPLib"; } 00138 00139 protected: 00141 float64_t* diag_H; 00143 float64_t** kernel_columns; 00145 float64_t* cache_index; 00147 int32_t first_kernel_inx; 00149 int64_t Cache_Size; 00151 int32_t m_num_data; 00153 float64_t m_reg_const; 00155 float64_t* m_vector_y; 00157 CKernel* m_kernel; 00158 00160 int32_t first_virt_inx; 00162 float64_t *virt_columns[3]; 00164 int32_t m_num_virt_data; 00166 int32_t m_num_classes; 00167 }; 00168 } 00169 #endif //GMNPLIB_H__