SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
base
Version.cpp
浏览该文件的文档.
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/base/SGObject.h
>
13
#include <
shogun/lib/versionstring.h
>
14
#include <
shogun/lib/RefCount.h
>
15
16
using namespace
shogun;
17
18
namespace
shogun
19
{
20
const
int32_t
Version::version_revision
=
VERSION_REVISION
;
21
const
int32_t
Version::version_year
=
VERSION_YEAR
;
22
const
int32_t
Version::version_month
=
VERSION_MONTH
;
23
const
int32_t
Version::version_day
=
VERSION_DAY
;
24
const
int32_t
Version::version_hour
=
VERSION_HOUR
;
25
const
int32_t
Version::version_minute
=
VERSION_MINUTE
;
26
const
int32_t
Version::version_parameter
=
VERSION_PARAMETER
;
27
const
char
Version::version_extra
[128] =
VERSION_EXTRA
;
28
const
char
Version::version_release
[128] =
VERSION_RELEASE
;
29
}
30
31
Version::Version
()
32
{
33
m_refcount =
new
RefCount
();
34
}
35
36
37
Version::~Version
()
38
{
39
delete
m_refcount;
40
}
41
42
void
Version::print_version
()
43
{
44
SG_SPRINT
(
"libshogun (%s/%s%d)\n\n"
,
MACHINE
,
VERSION_RELEASE
,
version_revision
)
45
SG_SPRINT
(
"Copyright (C) 1999-2009 Fraunhofer Institute FIRST\n"
)
46
SG_SPRINT
(
"Copyright (C) 1999-2011 Max Planck Society\n"
)
47
SG_SPRINT
(
"Copyright (C) 2009-2011 Berlin Institute of Technology\n"
)
48
SG_SPRINT
(
"Copyright (C) 2012-2014 Soeren Sonnenburg, Sergey Lisitsyn, Heiko Strathmann, Viktor Gal, Fernando Iglesias et al\n"
)
49
SG_SPRINT
(
"Written (W) 1999-2012 Soeren Sonnenburg, Gunnar Raetsch et al.\n\n"
)
50
#ifndef USE_SVMLIGHT
51
SG_SPRINT
(
"This is free software; see the source for copying conditions. There is NO\n"
)
52
SG_SPRINT
(
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
)
53
#endif
54
55
#ifdef LINKFLAGS
56
SG_SPRINT
(
"( configure options: \"%s\" compile flags: \"%s\" link flags: \"%s\" )\n"
,
57
CONFIGURE_OPTIONS
,
COMPFLAGS_CPP
,
LINKFLAGS
)
58
#else
59
SG_SPRINT
(
"( configure options: \"%s\" compile flags: \"%s\" link flags: None )\n"
,
60
CONFIGURE_OPTIONS
,
COMPFLAGS_CPP
)
61
#endif
62
}
63
64
const
char
*
Version::get_version_extra
()
65
{
66
return
version_extra
;
67
}
68
69
const
char
*
Version::get_version_release
()
70
{
71
return
version_release
;
72
}
73
74
int32_t
Version::get_version_revision
()
75
{
76
return
version_revision
;
77
}
78
79
int32_t
Version::get_version_year
()
80
{
81
return
version_year
;
82
}
83
84
int32_t
Version::get_version_month
()
85
{
86
return
version_month
;
87
}
88
89
int32_t
Version::get_version_day
()
90
{
91
return
version_day
;
92
}
93
94
int32_t
Version::get_version_hour
()
95
{
96
return
version_hour
;
97
}
98
99
int32_t
Version::get_version_minute
()
100
{
101
return
version_year
;
102
}
103
104
int32_t
Version::get_version_parameter
()
105
{
106
return
version_parameter
;
107
}
108
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
114
int32_t
Version::ref
()
115
{
116
return
m_refcount->
ref
();
117
}
118
119
int32_t
Version::ref_count
()
const
120
{
121
return
m_refcount->
ref_count
();
122
}
123
124
int32_t
Version::unref
()
125
{
126
int32_t rc = m_refcount->
unref
();
127
128
if
(rc==0)
129
{
130
delete
this
;
131
return
0;
132
}
133
134
return
rc;
135
}
SHOGUN
机器学习工具包 - 项目文档