SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Task.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  * Copyright (C) 2012 Sergey Lisitsyn
8  */
9 
10 #ifndef TASK_H_
11 #define TASK_H_
12 
13 #include <shogun/lib/config.h>
14 
15 #include <shogun/lib/SGVector.h>
16 #include <shogun/lib/List.h>
17 
18 namespace shogun
19 {
20 
27 class CTask : public CSGObject
28 {
29 public:
30 
32  CTask();
33 
40  CTask(index_t min_index, index_t max_index,
41  float64_t weight=1.0, const char* name="task");
42 
48  CTask(SGVector<index_t> indices, float64_t weight=1.0, const char* name="task");
49 
51  virtual ~CTask();
52 
57  bool is_contiguous();
58 
64 
69  void set_indices(SGVector<index_t> indices) { m_indices = indices; }
70 
75  float64_t get_weight() const { return m_weight; }
76 
81  void set_weight(float64_t weight) { m_weight = weight; }
82 
87  const char* get_task_name() const { return m_name; }
88 
93  void set_task_name(const char* name) { m_name = name; }
94 
100  void add_subtask(CTask* sub_task);
101 
106  CList* get_subtasks();
107 
112  int32_t get_num_subtasks();
113 
118  virtual const char* get_name() const { return "Task"; };
119 
120 private:
121 
123  void init();
124 
125 protected:
126 
129 
131  const char* m_name;
132 
135 
138 
139 };
140 
141 }
142 #endif

SHOGUN Machine Learning Toolbox - Documentation