SHOGUN  v3.2.0
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/SGVector.h>
14 #include <shogun/lib/List.h>
15 
16 namespace shogun
17 {
18 
25 class CTask : public CSGObject
26 {
27 public:
28 
30  CTask();
31 
38  CTask(index_t min_index, index_t max_index,
39  float64_t weight=1.0, const char* name="task");
40 
46  CTask(SGVector<index_t> indices, float64_t weight=1.0, const char* name="task");
47 
49  virtual ~CTask();
50 
55  bool is_contiguous();
56 
62 
67  void set_indices(SGVector<index_t> indices) { m_indices = indices; }
68 
73  float64_t get_weight() const { return m_weight; }
74 
79  void set_weight(float64_t weight) { m_weight = weight; }
80 
85  const char* get_task_name() const { return m_name; }
86 
91  void set_task_name(const char* name) { m_name = name; }
92 
98  void add_subtask(CTask* sub_task);
99 
104  CList* get_subtasks();
105 
110  int32_t get_num_subtasks();
111 
116  virtual const char* get_name() const { return "Task"; };
117 
118 private:
119 
121  void init();
122 
123 protected:
124 
127 
129  const char* m_name;
130 
133 
136 
137 };
138 
139 }
140 #endif
void set_indices(SGVector< index_t > indices)
Definition: Task.h:67
class Task used to represent tasks in multitask learning. Essentially it represent a set of feature v...
Definition: Task.h:25
virtual const char * get_name() const
Definition: Task.h:116
virtual ~CTask()
Definition: Task.cpp:55
int32_t index_t
Definition: common.h:60
bool is_contiguous()
Definition: Task.cpp:60
const char * m_name
Definition: Task.h:129
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:102
void set_weight(float64_t weight)
Definition: Task.h:79
double float64_t
Definition: common.h:48
void add_subtask(CTask *sub_task)
Definition: Task.cpp:76
SGVector< index_t > get_indices() const
Definition: Task.h:61
float64_t m_weight
Definition: Task.h:135
SGVector< index_t > m_indices
Definition: Task.h:132
void set_task_name(const char *name)
Definition: Task.h:91
int32_t get_num_subtasks()
Definition: Task.cpp:102
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
CList * m_subtasks
Definition: Task.h:126
const char * get_task_name() const
Definition: Task.h:85
float64_t get_weight() const
Definition: Task.h:73
Class List implements a doubly connected list for low-level-objects.
Definition: List.h:82
CList * get_subtasks()
Definition: Task.cpp:96

SHOGUN Machine Learning Toolbox - Documentation