SHOGUN  v3.0.0
 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>
12 #include <shogun/base/SGObject.h>
14 #include <shogun/lib/RefCount.h>
15 
16 using namespace shogun;
17 
18 namespace shogun
19 {
21 const int32_t Version::version_year = VERSION_YEAR;
23 const int32_t Version::version_day = VERSION_DAY;
24 const int32_t Version::version_hour = VERSION_HOUR;
27 const char Version::version_extra[128] = VERSION_EXTRA;
29 }
30 
32 {
33  m_refcount = new RefCount();
34 }
35 
36 
38 {
39  delete m_refcount;
40 }
41 
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 Soeren Sonnenburg, Sergey Lisitsyn, Heiko Strathmann\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  SG_SPRINT("( configure options: \"%s\" compile flags: \"%s\" link flags: \"%s\" )\n", CONFIGURE_OPTIONS, COMPFLAGS_CPP, LINKFLAGS)
55 }
56 
58 {
59  return version_extra;
60 }
61 
63 {
64  return version_release;
65 }
66 
68 {
69  return version_revision;
70 }
71 
73 {
74  return version_year;
75 }
76 
78 {
79  return version_month;
80 }
81 
83 {
84  return version_day;
85 }
86 
88 {
89  return version_hour;
90 }
91 
93 {
94  return version_year;
95 }
96 
98 {
99  return version_parameter;
100 }
101 
103 {
104  return ((((version_year)*12 + version_month)*30 + version_day)* 24 + version_hour)*60 + version_minute;
105 }
106 
107 int32_t Version::ref()
108 {
109  return m_refcount->ref();
110 }
111 
112 int32_t Version::ref_count() const
113 {
114  return m_refcount->ref_count();
115 }
116 
117 int32_t Version::unref()
118 {
119  int32_t rc = m_refcount->unref();
120 
121  if (rc==0)
122  {
123  delete this;
124  return 0;
125  }
126 
127  return rc;
128 }

SHOGUN Machine Learning Toolbox - Documentation