SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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/base/SGObject.h>
15 #include <shogun/structure/Plif.h>
18 #include <shogun/lib/Array.h>
19 #include <shogun/lib/Array2.h>
20 #include <shogun/lib/Array3.h>
21 
22 namespace shogun
23 {
24 template <class T> class SGString;
25 
28 class CPlifMatrix: public CSGObject
29 {
30  public:
34  CPlifMatrix();
35 
39  ~CPlifMatrix();
40 
45  inline CPlif** get_PEN() { return m_PEN; }
46 
51  inline CPlifBase** get_plif_matrix() { return m_plif_matrix; }
52 
58  inline int32_t get_num_states() { return m_num_states; }
59 
60 
66 
71  inline int32_t get_num_plifs() { return m_num_plifs; }
72 
77  inline int32_t get_num_limits() { return m_num_limits; }
78 
84  void create_plifs(int32_t num_plifs, int32_t num_limits);
85 
91 
97 
102  void set_plif_max_values(SGVector<float64_t> max_values);
103 
108  void set_plif_use_cache(SGVector<bool> use_cache);
109 
114  void set_plif_use_svm(SGVector<int32_t> use_svm);
115 
122 
128  void set_plif_penalties(SGMatrix<float64_t> penalties);
129 
136  void set_plif_names(SGString<char>* names, int32_t num_values, int32_t maxlen=0);
137 
146  void set_plif_transform_type(SGString<char>* transform_type, int32_t num_values, int32_t maxlen=0);
147 
153  inline int32_t get_plif_id(int32_t idx)
154  {
155  int32_t id = m_ids[idx];
156  if (id>=m_num_plifs)
157  SG_ERROR("plif id (%i) exceeds array length (%i)\n",id,m_num_plifs);
158  return id;
159  }
160 
169  bool compute_plif_matrix(SGNDArray<float64_t> penalties_array);
170 
177  bool compute_signal_plifs(SGMatrix<int32_t> state_signals);
178 
185  void set_plif_state_signal_matrix(int32_t *plif_id_matrix, int32_t m, int32_t n);
186 
187 
189  inline virtual const char* get_name() const { return "PlifMatrix"; }
190 
191  protected:
192 
195 
197  int32_t m_num_plifs;
198 
200  int32_t m_num_limits;
201 
203  int32_t m_num_states;
204 
207 
210 
213 
216 };
217 }
218 #endif /* _PLIFMATRIX_H_ */
CArray< int32_t > m_ids
Definition: PlifMatrix.h:209
CPlifBase ** m_state_signals
Definition: PlifMatrix.h:215
void set_plif_transform_type(SGString< char > *transform_type, int32_t num_values, int32_t maxlen=0)
Definition: PlifMatrix.cpp:159
CPlifBase ** get_plif_matrix()
Definition: PlifMatrix.h:51
#define SG_ERROR(...)
Definition: SGIO.h:75
CPlifBase ** get_state_signals()
Definition: PlifMatrix.h:65
int32_t get_num_limits()
Definition: PlifMatrix.h:77
void set_plif_use_cache(SGVector< bool > use_cache)
Definition: PlifMatrix.cpp:80
virtual const char * get_name() const
Definition: PlifMatrix.h:189
class Plif
Definition: Plif.h:37
void set_plif_state_signal_matrix(int32_t *plif_id_matrix, int32_t m, int32_t n)
Definition: PlifMatrix.cpp:272
int32_t get_num_states()
Definition: PlifMatrix.h:58
bool compute_plif_matrix(SGNDArray< float64_t > penalties_array)
Definition: PlifMatrix.cpp:182
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:76
void set_plif_penalties(SGMatrix< float64_t > penalties)
Definition: PlifMatrix.cpp:124
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:21
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:153
int32_t get_num_plifs()
Definition: PlifMatrix.h:71
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:145
bool compute_signal_plifs(SGMatrix< int32_t > state_signals)
Definition: PlifMatrix.cpp:245
CPlif ** get_PEN()
Definition: PlifMatrix.h:45
CPlifBase ** m_plif_matrix
Definition: PlifMatrix.h:212
shogun n-dimensional array
Definition: DataType.h:374
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:28

SHOGUN Machine Learning Toolbox - Documentation