|
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 GNPPLIB_H__ 00016 #define GNPPLIB_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 { 00031 class CGNPPLib: public CSGObject 00032 { 00033 public: 00041 CGNPPLib(float64_t* vector_y, CKernel* kernel, int32_t num_data, float64_t reg_const); 00042 virtual ~CGNPPLib(); 00043 00050 int8_t gnpp_mdm(float64_t *diag_H, 00051 float64_t *vector_c, 00052 float64_t *vector_y, 00053 int32_t dim, 00054 int32_t tmax, 00055 float64_t tolabs, 00056 float64_t tolrel, 00057 float64_t th, 00058 float64_t *alpha, 00059 int32_t *ptr_t, 00060 float64_t *ptr_aHa11, 00061 float64_t *ptr_aHa22, 00062 float64_t **ptr_History, 00063 int32_t verb); 00064 00071 int8_t gnpp_imdm(float64_t *diag_H, 00072 float64_t *vector_c, 00073 float64_t *vector_y, 00074 int32_t dim, 00075 int32_t tmax, 00076 float64_t tolabs, 00077 float64_t tolrel, 00078 float64_t th, 00079 float64_t *alpha, 00080 int32_t *ptr_t, 00081 float64_t *ptr_aHa11, 00082 float64_t *ptr_aHa22, 00083 float64_t **ptr_History, 00084 int32_t verb); 00085 00087 inline virtual const char* get_name() const { return "GNPPLib"; } 00088 00089 protected: 00096 float64_t* get_col(int64_t a, int64_t b); 00097 00099 float64_t** kernel_columns; 00101 float64_t* cache_index; 00103 int32_t first_kernel_inx; 00105 int64_t Cache_Size; 00107 int32_t m_num_data; 00109 float64_t m_reg_const; 00111 float64_t* m_vector_y; 00113 CKernel* m_kernel; 00114 00115 }; 00116 } 00117 #endif // GNPPLIB_H__