SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>
13 
14 using namespace shogun;
15 
16 namespace shogun
17 {
19 const int32_t Version::version_year = VERSION_YEAR;
21 const int32_t Version::version_day = VERSION_DAY;
22 const int32_t Version::version_hour = VERSION_HOUR;
25 const char Version::version_extra[128] = VERSION_EXTRA;
27 }
28 
29 Version::Version() : refcount(0)
30 {
31 }
32 
33 
35 {
36 }
37 
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("Written (W) 1999-2011 Soeren Sonnenburg, Gunnar Raetsch et al.\n\n");
46 #ifndef USE_SVMLIGHT
47  SG_SPRINT("This is free software; see the source for copying conditions. There is NO\n");
48  SG_SPRINT("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");
49 #endif
50  SG_SPRINT( "( configure options: \"%s\" compile flags: \"%s\" link flags: \"%s\" )\n", CONFIGURE_OPTIONS, COMPFLAGS_CPP, LINKFLAGS);
51 }
52 
55 {
56  return version_extra;
57 }
58 
61 {
62  return version_release;
63 }
64 
67 {
68  return version_revision;
69 }
70 
73 {
74  return version_year;
75 }
76 
79 {
80  return version_month;
81 }
82 
85 {
86  return version_day;
87 }
88 
91 {
92  return version_hour;
93 }
94 
97 {
98  return version_year;
99 }
100 
103 {
104  return version_parameter;
105 }
106 
109 {
110  return ((((version_year)*12 + version_month)*30 + version_day)* 24 + version_hour)*60 + version_minute;
111 }
112 
116 int32_t Version::ref()
117 {
118  ++refcount;
119  return refcount;
120 }
121 
125 int32_t Version::ref_count() const
126 {
127  return refcount;
128 }
129 
133 int32_t Version::unref()
134 {
135  if (refcount==0 || --refcount==0)
136  {
137  delete this;
138  return 0;
139  }
140  else
141  return refcount;
142 }
#define MACHINE
Definition: config.h:51
int32_t unref()
Definition: Version.cpp:133
static const char * get_version_release()
Definition: Version.cpp:60
#define VERSION_EXTRA
Definition: versionstring.h:2
virtual ~Version()
Definition: Version.cpp:34
static const char * get_version_extra()
Definition: Version.cpp:54
#define VERSION_HOUR
Definition: versionstring.h:8
#define VERSION_MINUTE
Definition: versionstring.h:9
static int32_t get_version_hour()
Definition: Version.cpp:90
int32_t ref_count() const
Definition: Version.cpp:125
static int32_t get_version_year()
Definition: Version.cpp:72
static int32_t get_version_month()
Definition: Version.cpp:78
#define VERSION_DAY
Definition: versionstring.h:7
#define VERSION_YEAR
Definition: versionstring.h:5
static int32_t get_version_parameter()
Definition: Version.cpp:102
#define COMPFLAGS_CPP
Definition: config.h:53
static const char version_release[128]
Definition: Version.h:89
static const char version_extra[128]
Definition: Version.h:91
static int32_t get_version_day()
Definition: Version.cpp:84
#define SG_SPRINT(...)
Definition: SGIO.h:95
static const int32_t version_revision
Definition: Version.h:94
#define VERSION_MONTH
Definition: versionstring.h:6
#define CONFIGURE_OPTIONS
Definition: config.h:50
static const int32_t version_day
Definition: Version.h:100
static const int32_t version_year
Definition: Version.h:96
#define VERSION_PARAMETER
Definition: versionstring.h:10
static const int32_t version_hour
Definition: Version.h:102
#define LINKFLAGS
Definition: config.h:54
static const int32_t version_parameter
Definition: Version.h:106
static const int32_t version_month
Definition: Version.h:98
#define VERSION_RELEASE
Definition: versionstring.h:4
static int64_t get_version_in_minutes()
Definition: Version.cpp:108
static int32_t get_version_revision()
Definition: Version.cpp:66
static int32_t get_version_minute()
Definition: Version.cpp:96
int32_t ref()
Definition: Version.cpp:116
static const int32_t version_minute
Definition: Version.h:104
static void print_version()
Definition: Version.cpp:39
#define VERSION_REVISION
Definition: versionstring.h:3

SHOGUN Machine Learning Toolbox - Documentation