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 int32_t get_num_plifs() 00041 { 00042 return m_array.get_num_elements(); 00043 } 00044 00050 virtual float64_t lookup_penalty( 00051 float64_t p_value, float64_t* svm_values) const; 00052 00058 virtual float64_t lookup_penalty( 00059 int32_t p_value, float64_t* svm_values) const; 00060 00062 virtual void penalty_clear_derivative(); 00063 00069 virtual void penalty_add_derivative( 00070 float64_t p_value, float64_t* svm_values); 00071 00076 virtual float64_t get_max_value() const 00077 { 00078 return max_value; 00079 } 00080 00085 virtual float64_t get_min_value() const 00086 { 00087 return min_value; 00088 } 00089 00094 virtual bool uses_svm_values() const; 00095 00100 virtual int32_t get_max_id() const; 00101 00102 void get_used_svms(int32_t* num_svms, int32_t* svm_ids); 00103 00104 protected: 00106 CDynamicArray<CPlifBase*> m_array; 00108 float64_t max_value; 00110 float64_t min_value; 00111 }; 00112 00113 #endif