SHOGUN
v2.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
transfer
multitask
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
61
SGVector<index_t>
get_indices
()
const
{
return
m_indices
; }
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
126
CList
*
m_subtasks
;
127
129
const
char
*
m_name
;
130
132
SGVector<index_t>
m_indices
;
133
135
float64_t
m_weight
;
136
137
};
138
139
}
140
#endif
SHOGUN
Machine Learning Toolbox - Documentation