SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PlifMatrix.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2009 Soeren Sonnenburg
8  * Copyright (C) 2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _PLIFMATRIX_H_
12 #define _PLIFMATRIX_H_
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/DataType.h>
17 #include <shogun/lib/SGNDArray.h>
18 #include <shogun/lib/SGMatrix.h>
19 #include <shogun/base/SGObject.h>
20 #include <shogun/structure/Plif.h>
24 
25 namespace shogun
26 {
27 template <class T> class SGString;
28 
31 class CPlifMatrix: public CSGObject
32 {
33  public:
37  CPlifMatrix();
38 
42  ~CPlifMatrix();
43 
48  inline CPlif** get_PEN() { return m_PEN; }
49 
54  inline CPlifBase** get_plif_matrix() { return m_plif_matrix; }
55 
61  inline int32_t get_num_states() { return m_num_states; }
62 
63 
69 
74  inline int32_t get_num_plifs() { return m_num_plifs; }
75 
80  inline int32_t get_num_limits() { return m_num_limits; }
81 
87  void create_plifs(int32_t num_plifs, int32_t num_limits);
88 
94 
100 
105  void set_plif_max_values(SGVector<float64_t> max_values);
106 
111  void set_plif_use_cache(SGVector<bool> use_cache);
112 
117  void set_plif_use_svm(SGVector<int32_t> use_svm);
118 
125 
131  void set_plif_penalties(SGMatrix<float64_t> penalties);
132 
139  void set_plif_names(SGString<char>* names, int32_t num_values, int32_t maxlen=0);
140 
149  void set_plif_transform_type(SGString<char>* transform_type, int32_t num_values, int32_t maxlen=0);
150 
156  inline int32_t get_plif_id(int32_t idx)
157  {
158  int32_t id = m_ids[idx];
159  if (id>=m_num_plifs)
160  SG_ERROR("plif id (%i) exceeds array length (%i)\n",id,m_num_plifs)
161  return id;
162  }
163 
172  bool compute_plif_matrix(SGNDArray<float64_t> penalties_array);
173 
180  bool compute_signal_plifs(SGMatrix<int32_t> state_signals);
181 
188  void set_plif_state_signal_matrix(int32_t *plif_id_matrix, int32_t m, int32_t n);
189 
190 
192  virtual const char* get_name() const { return "PlifMatrix"; }
193 
194  protected:
195 
198 
200  int32_t m_num_plifs;
201 
203  int32_t m_num_limits;
204 
206  int32_t m_num_states;
207 
210 
213 
216 
219 };
220 }
221 #endif /* _PLIFMATRIX_H_ */
CPlifBase ** m_state_signals
Definition: PlifMatrix.h:218
CDynamicArray< int32_t > m_ids
Definition: PlifMatrix.h:212
void set_plif_transform_type(SGString< char > *transform_type, int32_t num_values, int32_t maxlen=0)
Definition: PlifMatrix.cpp:157
CPlifBase ** get_plif_matrix()
Definition: PlifMatrix.h:54
#define SG_ERROR(...)
Definition: SGIO.h:129
CPlifBase ** get_state_signals()
Definition: PlifMatrix.h:68
int32_t get_num_limits()
Definition: PlifMatrix.h:80
void set_plif_use_cache(SGVector< bool > use_cache)
Definition: PlifMatrix.cpp:80
virtual const char * get_name() const
Definition: PlifMatrix.h:192
class Plif
Definition: Plif.h:40
void set_plif_state_signal_matrix(int32_t *plif_id_matrix, int32_t m, int32_t n)
Definition: PlifMatrix.cpp:270
int32_t get_num_states()
Definition: PlifMatrix.h:61
bool compute_plif_matrix(SGNDArray< float64_t > penalties_array)
Definition: PlifMatrix.cpp:180
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
void set_plif_penalties(SGMatrix< float64_t > penalties)
Definition: PlifMatrix.cpp:123
void set_plif_limits(SGMatrix< float64_t > limits)
Definition: PlifMatrix.cpp:104
void set_plif_min_values(SGVector< float64_t > min_values)
Definition: PlifMatrix.cpp:56
class PlifBase
Definition: PlifBase.h:23
void set_plif_ids(SGVector< int32_t > ids)
Definition: PlifMatrix.cpp:41
void set_plif_use_svm(SGVector< int32_t > use_svm)
Definition: PlifMatrix.cpp:92
int32_t get_plif_id(int32_t idx)
Definition: PlifMatrix.h:156
int32_t get_num_plifs()
Definition: PlifMatrix.h:74
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
void set_plif_max_values(SGVector< float64_t > max_values)
Definition: PlifMatrix.cpp:68
void set_plif_names(SGString< char > *names, int32_t num_values, int32_t maxlen=0)
Definition: PlifMatrix.cpp:143
bool compute_signal_plifs(SGMatrix< int32_t > state_signals)
Definition: PlifMatrix.cpp:243
CPlif ** get_PEN()
Definition: PlifMatrix.h:48
CPlifBase ** m_plif_matrix
Definition: PlifMatrix.h:215
void create_plifs(int32_t num_plifs, int32_t num_limits)
Definition: PlifMatrix.cpp:27
store plif arrays for all transitions in the model
Definition: PlifMatrix.h:31

SHOGUN Machine Learning Toolbox - Documentation