PlifArray.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 1999-2008 Gunnar Raetsch
00008  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef __PLIFARRAY_H__
00012 #define __PLIFARRAY_H__
00013 
00014 #include "lib/common.h"
00015 #include "lib/Mathematics.h"
00016 #include "lib/DynamicArray.h"
00017 #include "structure/PlifBase.h"
00018 
00020 class CPlifArray: public CPlifBase
00021 {
00022     public:
00024         CPlifArray();
00025         virtual ~CPlifArray();
00026 
00031         void add_plif(CPlifBase* new_plif);
00032 
00034         void clear();
00035 
00040         INT get_num_plifs()
00041         {
00042             return m_array.get_num_elements();
00043         }
00044 
00050         virtual DREAL lookup_penalty(DREAL p_value, DREAL* svm_values) const;
00051 
00057         virtual DREAL lookup_penalty(INT p_value, DREAL* svm_values) const;
00058 
00060         virtual void penalty_clear_derivative();
00061 
00067         virtual void penalty_add_derivative(DREAL p_value, DREAL* svm_values);
00068 
00073         virtual DREAL get_max_value() const
00074         {
00075             return max_value;
00076         }
00077 
00082         virtual DREAL get_min_value() const
00083         {
00084             return min_value;
00085         }
00086 
00091         virtual bool uses_svm_values() const;
00092 
00097         virtual INT get_max_id() const;
00098 
00099         void get_used_svms(INT* num_svms, INT* svm_ids);
00100     protected:
00102         CDynamicArray<CPlifBase*> m_array;
00104         DREAL max_value;
00106         DREAL min_value;
00107 };
00108 
00109 #endif

SHOGUN Machine Learning Toolbox - Documentation