SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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 #include <shogun/lib/config.h>
14 #include <shogun/lib/memory.h>
15 #include <shogun/io/SGIO.h>
16 #include <shogun/lib/RefCount.h>
17 
18 using namespace shogun;
19 
20 namespace shogun
21 {
22 const int32_t Version::version_revision = VERSION_REVISION;
23 const int32_t Version::version_year = VERSION_YEAR;
24 const int32_t Version::version_month = VERSION_MONTH;
25 const int32_t Version::version_day = VERSION_DAY;
26 const int32_t Version::version_hour = VERSION_HOUR;
27 const int32_t Version::version_minute = VERSION_MINUTE;
28 const int32_t Version::version_parameter=VERSION_PARAMETER;
29 const char Version::version_extra[128] = VERSION_EXTRA;
30 const char Version::version_release[128] = VERSION_RELEASE;
31 }
32 
34 {
35  m_refcount = new RefCount();
36 }
37 
38 
40 {
41  delete m_refcount;
42 }
43 
45 {
46  SG_SPRINT("libshogun (%s/%s%d)\n\n", MACHINE, VERSION_RELEASE, version_revision)
47  SG_SPRINT("Copyright (C) 1999-2009 Fraunhofer Institute FIRST\n")
48  SG_SPRINT("Copyright (C) 1999-2011 Max Planck Society\n")
49  SG_SPRINT("Copyright (C) 2009-2011 Berlin Institute of Technology\n")
50  SG_SPRINT("Copyright (C) 2012-2014 Soeren Sonnenburg, Sergey Lisitsyn, Heiko Strathmann, Viktor Gal, Fernando Iglesias et al\n")
51  SG_SPRINT("Written (W) 1999-2012 Soeren Sonnenburg, Gunnar Raetsch et al.\n\n")
52 #ifndef USE_SVMLIGHT
53  SG_SPRINT("This is free software; see the source for copying conditions. There is NO\n")
54  SG_SPRINT("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n")
55 #endif
56 
57 #ifdef LINKFLAGS
58  SG_SPRINT("( configure options: \"%s\" compile flags: \"%s\" link flags: \"%s\" )\n",
60 #else
61  SG_SPRINT("( configure options: \"%s\" compile flags: \"%s\" link flags: None )\n",
63 #endif
64 }
65 
67 {
68  return version_extra;
69 }
70 
72 {
73  return version_release;
74 }
75 
77 {
78  return version_revision;
79 }
80 
82 {
83  return version_year;
84 }
85 
87 {
88  return version_month;
89 }
90 
92 {
93  return version_day;
94 }
95 
97 {
98  return version_hour;
99 }
100 
102 {
103  return version_year;
104 }
105 
107 {
108  return version_parameter;
109 }
110 
112 {
113  return ((((version_year)*12 + version_month)*30 + version_day)* 24 + version_hour)*60 + version_minute;
114 }
115 
116 int32_t Version::ref()
117 {
118  return m_refcount->ref();
119 }
120 
121 int32_t Version::ref_count() const
122 {
123  return m_refcount->ref_count();
124 }
125 
126 int32_t Version::unref()
127 {
128  int32_t rc = m_refcount->unref();
129 
130  if (rc==0)
131  {
132  delete this;
133  return 0;
134  }
135 
136  return rc;
137 }
#define MACHINE
Definition: config.h:4
int32_t unref()
Definition: Version.cpp:126
static const char * get_version_release()
Definition: Version.cpp:71
virtual ~Version()
Definition: Version.cpp:39
static const char * get_version_extra()
Definition: Version.cpp:66
static int32_t get_version_hour()
Definition: Version.cpp:96
int32_t ref_count()
Definition: RefCount.cpp:31
int32_t ref_count() const
Definition: Version.cpp:121
static int32_t get_version_year()
Definition: Version.cpp:81
static int32_t get_version_month()
Definition: Version.cpp:86
static int32_t get_version_parameter()
Definition: Version.cpp:106
#define COMPFLAGS_CPP
Definition: config.h:6
static const char version_release[128]
Definition: Version.h:86
static const char version_extra[128]
Definition: Version.h:88
static int32_t get_version_day()
Definition: Version.cpp:91
#define SG_SPRINT(...)
Definition: SGIO.h:180
int32_t unref()
Definition: RefCount.cpp:18
static const int32_t version_revision
Definition: Version.h:91
#define CONFIGURE_OPTIONS
Definition: config.h:5
static const int32_t version_day
Definition: Version.h:97
static const int32_t version_year
Definition: Version.h:93
static const int32_t version_hour
Definition: Version.h:99
int32_t ref()
Definition: RefCount.cpp:5
#define LINKFLAGS
Definition: config.h:7
static const int32_t version_parameter
Definition: Version.h:103
static const int32_t version_month
Definition: Version.h:95
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
static int64_t get_version_in_minutes()
Definition: Version.cpp:111
static int32_t get_version_revision()
Definition: Version.cpp:76
static int32_t get_version_minute()
Definition: Version.cpp:101
int32_t ref()
Definition: Version.cpp:116
static const int32_t version_minute
Definition: Version.h:101
static void print_version()
Definition: Version.cpp:44

SHOGUN Machine Learning Toolbox - Documentation