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
base
Version.cpp
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) 1999-2009 Soeren Sonnenburg
8
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#include <
shogun/base/Version.h
>
12
#include <
shogun/lib/versionstring.h
>
13
14
using namespace
shogun;
15
16
namespace
shogun
17
{
18
const
int32_t
Version::version_revision
=
VERSION_REVISION
;
19
const
int32_t
Version::version_year
=
VERSION_YEAR
;
20
const
int32_t
Version::version_month
=
VERSION_MONTH
;
21
const
int32_t
Version::version_day
=
VERSION_DAY
;
22
const
int32_t
Version::version_hour
=
VERSION_HOUR
;
23
const
int32_t
Version::version_minute
=
VERSION_MINUTE
;
24
const
int32_t
Version::version_parameter
=
VERSION_PARAMETER
;
25
const
char
Version::version_extra
[128] =
VERSION_EXTRA
;
26
const
char
Version::version_release
[128] =
VERSION_RELEASE
;
27
}
28
29
Version::Version
() : refcount(0)
30
{
31
}
32
33
34
Version::~Version
()
35
{
36
}
37
39
void
Version::print_version
()
40
{
41
SG_SPRINT
(
"libshogun (%s/%s%d)\n\n"
,
MACHINE
,
VERSION_RELEASE
,
version_revision
);
42
SG_SPRINT
(
"Copyright (C) 1999-2009 Fraunhofer Institute FIRST\n"
);
43
SG_SPRINT
(
"Copyright (C) 1999-2011 Max Planck Society\n"
);
44
SG_SPRINT
(
"Copyright (C) 2009-2011 Berlin Institute of Technology\n"
);
45
SG_SPRINT
(
"Copyright (C) 2012 Soeren Sonnenburg, Sergey Lisitsyn, Heiko Strathmann\n"
);
46
SG_SPRINT
(
"Written (W) 1999-2012 Soeren Sonnenburg, Gunnar Raetsch et al.\n\n"
);
47
#ifndef USE_SVMLIGHT
48
SG_SPRINT
(
"This is free software; see the source for copying conditions. There is NO\n"
);
49
SG_SPRINT
(
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
);
50
#endif
51
SG_SPRINT
(
"( configure options: \"%s\" compile flags: \"%s\" link flags: \"%s\" )\n"
,
CONFIGURE_OPTIONS
,
COMPFLAGS_CPP
,
LINKFLAGS
);
52
}
53
55
const
char
*
Version::get_version_extra
()
56
{
57
return
version_extra
;
58
}
59
61
const
char
*
Version::get_version_release
()
62
{
63
return
version_release
;
64
}
65
67
int32_t
Version::get_version_revision
()
68
{
69
return
version_revision
;
70
}
71
73
int32_t
Version::get_version_year
()
74
{
75
return
version_year
;
76
}
77
79
int32_t
Version::get_version_month
()
80
{
81
return
version_month
;
82
}
83
85
int32_t
Version::get_version_day
()
86
{
87
return
version_day
;
88
}
89
91
int32_t
Version::get_version_hour
()
92
{
93
return
version_hour
;
94
}
95
97
int32_t
Version::get_version_minute
()
98
{
99
return
version_year
;
100
}
101
103
int32_t
Version::get_version_parameter
()
104
{
105
return
version_parameter
;
106
}
107
109
int64_t
Version::get_version_in_minutes
()
110
{
111
return
((((
version_year
)*12 +
version_month
)*30 +
version_day
)* 24 +
version_hour
)*60 +
version_minute
;
112
}
113
117
int32_t
Version::ref
()
118
{
119
++refcount;
120
return
refcount;
121
}
122
126
int32_t
Version::ref_count
()
const
127
{
128
return
refcount;
129
}
130
134
int32_t
Version::unref
()
135
{
136
if
(refcount==0 || --refcount==0)
137
{
138
delete
this
;
139
return
0;
140
}
141
else
142
return
refcount;
143
}
SHOGUN
Machine Learning Toolbox - Documentation