gmnplib.h

Go to the documentation of this file.
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 
00064 class CGMNPLib: public CSGObject
00065 {
00066     public:
00076         CGMNPLib(
00077             float64_t* vector_y, CKernel* kernel, int32_t num_data,
00078             int32_t num_virtual_data, int32_t num_classes, float64_t reg_const);
00079 
00080         virtual ~CGMNPLib();
00081 
00091         int8_t gmnp_imdm(float64_t *vector_c,
00092                 int32_t dim,
00093                 int32_t tmax,
00094                 float64_t tolabs,
00095                 float64_t tolrel,
00096                 float64_t th,
00097                 float64_t *alpha,
00098                 int32_t  *ptr_t,
00099                 float64_t **ptr_History,
00100                 int32_t verb);
00101 
00108         void get_indices2( int32_t *index, int32_t *c, int32_t i );
00109 
00110     protected:
00116         float64_t *get_kernel_col( int32_t a );
00117 
00124         float64_t* get_col( int32_t a, int32_t b );
00125 
00132         float64_t kernel_fce( int32_t a, int32_t b );
00133 
00135         inline virtual const char* get_name() const { return "GMNPLib"; }
00136 
00137     protected:
00139         float64_t* diag_H;
00141         float64_t** kernel_columns;
00143         float64_t* cache_index;
00145         int32_t first_kernel_inx;
00147         int64_t Cache_Size;
00149         int32_t m_num_data;
00151         float64_t m_reg_const;
00153         float64_t* m_vector_y;
00155         CKernel* m_kernel;
00156 
00158         int32_t first_virt_inx;
00160         float64_t *virt_columns[3];
00162         int32_t m_num_virt_data;
00164         int32_t m_num_classes;
00165 };
00166 
00167 
00168 #endif //GMNPLIB_H__

SHOGUN Machine Learning Toolbox - Documentation