SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #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 {
23 const int32_t Version::version_year = VERSION_YEAR;
25 const int32_t Version::version_day = VERSION_DAY;
26 const int32_t Version::version_hour = VERSION_HOUR;
29 const char Version::version_extra[128] = VERSION_EXTRA;
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 }

SHOGUN Machine Learning Toolbox - Documentation