SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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
void set_indices(SGVector< index_t > indices)
Definition: Task.h:69
class Task used to represent tasks in multitask learning. Essentially it represent a set of feature v...
Definition: Task.h:27
virtual const char * get_name() const
Definition: Task.h:118
virtual ~CTask()
Definition: Task.cpp:55
int32_t index_t
Definition: common.h:62
bool is_contiguous()
Definition: Task.cpp:60
const char * m_name
Definition: Task.h:131
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
void set_weight(float64_t weight)
Definition: Task.h:81
double float64_t
Definition: common.h:50
void add_subtask(CTask *sub_task)
Definition: Task.cpp:76
SGVector< index_t > get_indices() const
Definition: Task.h:63
float64_t m_weight
Definition: Task.h:137
SGVector< index_t > m_indices
Definition: Task.h:134
void set_task_name(const char *name)
Definition: Task.h:93
int32_t get_num_subtasks()
Definition: Task.cpp:102
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
CList * m_subtasks
Definition: Task.h:128
const char * get_task_name() const
Definition: Task.h:87
float64_t get_weight() const
Definition: Task.h:75
Class List implements a doubly connected list for low-level-objects.
Definition: List.h:84
CList * get_subtasks()
Definition: Task.cpp:96

SHOGUN Machine Learning Toolbox - Documentation