Skip to content

Commit

Permalink
Fixed spacings at SGObject
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Oct 29, 2011
1 parent e9c8ecd commit 5ced67a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
24 changes: 13 additions & 11 deletions src/shogun/base/SGObject.cpp
Expand Up @@ -351,17 +351,17 @@ bool CSGObject::load_serializable(CSerializableFile* file,
if (file_version<0)
{
SG_WARNING("%s%s::load_serializable(): File contains no parameter "
"version. Seems like your file is from the days before this "
"was introduced. Ignore warning or serialize with this version "
"of shogun to get rid of above and this warnings.\n",
prefix, get_name());
"version. Seems like your file is from the days before this "
"was introduced. Ignore warning or serialize with this version "
"of shogun to get rid of above and this warnings.\n",
prefix, get_name());
}

if (file_version>version->get_version_parameter())
{
SG_WARNING("%s%s::load_serializable(): parameter version of file "
"larger than the one of shogun. Try with a more recent version "
"of shogun.\n", prefix, get_name());
"larger than the one of shogun. Try with a more recent version "
"of shogun.\n", prefix, get_name());
return false;
}

Expand All @@ -375,16 +375,16 @@ bool CSGObject::load_serializable(CSerializableFile* file,
catch (ShogunException e)
{
SG_SWARNING("%s%s::load_serializable_post(): ShogunException: "
"%s\n", prefix, get_name(),
e.get_exception_string());
"%s\n", prefix, get_name(),
e.get_exception_string());
return false;
}

if (!m_load_post_called)
{
SG_SWARNING("%s%s::load_serializable_post(): Implementation "
"error: BASE_CLASS::LOAD_SERIALIZABLE_POST() not "
"called!\n", prefix, get_name());
"error: BASE_CLASS::LOAD_SERIALIZABLE_POST() not "
"called!\n", prefix, get_name());
return false;
}
SG_DEBUG("DONE LOADING CSGObject '%s' (%p)\n", get_name(), this);
Expand All @@ -398,7 +398,7 @@ bool CSGObject::save_parameter_version(CSerializableFile* file,
TSGDataType t(CT_SCALAR, ST_NONE, PT_INT32);
int32_t v=version->get_version_parameter();
TParameter p(&t, &v, "version_parameter",
"Version of parameters of this object");
"Version of parameters of this object");
return p.save(file, prefix);
}

Expand Down Expand Up @@ -438,6 +438,7 @@ void CSGObject::save_serializable_post() throw (ShogunException)
#include <shogun/lib/Set.h>
extern CSet<shogun::MemoryBlock>* sg_mallocs;
#endif

void CSGObject::init()
{
#ifdef HAVE_PTHREAD
Expand All @@ -455,6 +456,7 @@ void CSGObject::init()
}
}
#endif

m_refcount = 0;
io = NULL;
parallel = NULL;
Expand Down
15 changes: 8 additions & 7 deletions src/shogun/base/SGObject.h
Expand Up @@ -83,7 +83,7 @@ class CSGObject
CSGObject(const CSGObject& orig);

/** destructor */
virtual ~CSGObject();
virtual ~CSGObject();

#ifdef USE_REFERENCE_COUNTING
/** increase reference counter
Expand Down Expand Up @@ -148,7 +148,7 @@ class CSGObject
* @return TRUE if done, otherwise FALSE
*/
virtual bool save_serializable(CSerializableFile* file,
const char* prefix="");
const char* prefix="");

/** Load this object from file. If it will fail (returning FALSE)
* then this object will contain inconsistent data and should not
Expand All @@ -160,7 +160,7 @@ class CSGObject
* @return TRUE if done, otherwise FALSE
*/
virtual bool load_serializable(CSerializableFile* file,
const char* prefix="");
const char* prefix="");

/** set the io object
*
Expand Down Expand Up @@ -219,10 +219,10 @@ class CSGObject
index_t get_modsel_param_index(const char* param_name);

#ifdef TRACE_MEMORY_ALLOCS
static void list_memory_allocs()
{
::list_memory_allocs();
}
static void list_memory_allocs()
{
::list_memory_allocs();
}
#endif

protected:
Expand Down Expand Up @@ -300,6 +300,7 @@ class CSGObject
Parameter* m_model_selection_parameters;

private:

EPrimitiveType m_generic;
bool m_load_pre_called;
bool m_load_post_called;
Expand Down

0 comments on commit 5ced67a

Please sign in to comment.