13 #ifndef __SGOBJECT_H__
14 #define __SGOBJECT_H__
38 class CSerializableFile;
40 template <
class T,
class K>
class CMap;
50 #define VA_NARGS_IMPL(_1, _2, _3, _4, _5, N, ...) N
51 #define VA_NARGS(...) VA_NARGS_IMPL(__VA_ARGS__, 5, 4, 3, 2, 1)
53 #define VARARG_IMPL2(base, count, ...) base##count(__VA_ARGS__)
54 #define VARARG_IMPL(base, count, ...) VARARG_IMPL2(base, count, __VA_ARGS__)
55 #define VARARG(base, ...) VARARG_IMPL(base, VA_NARGS(__VA_ARGS__), __VA_ARGS__)
57 #define SG_ADD4(param, name, description, ms_available) {\
58 m_parameters->add(param, name, description);\
60 m_model_selection_parameters->add(param, name, description);\
63 #define SG_ADD5(param, name, description, ms_available, gradient_available) {\
64 m_parameters->add(param, name, description);\
66 m_model_selection_parameters->add(param, name, description);\
67 if (gradient_available)\
68 m_gradient_parameters->add(param, name, description);\
71 #define SG_ADD(...) VARARG(SG_ADD, __VA_ARGS__)
137 virtual const char*
get_name()
const = 0;
147 virtual bool is_generic(EPrimitiveType*
generic)
const;
206 const char* prefix=
"");
221 int32_t current_version,
239 int32_t& base_version,
356 TParameter*& to_migrate,
char* old_name=NULL);
430 void set_global_objects();
431 void unset_global_objects();
439 bool is_param_new(const
SGParamInfo param_info) const;
450 int32_t param_version=
Version::get_version_parameter());
456 const
char* prefix="");
468 void get_parameter_incremental_hash(
Parameter* param,
469 uint32_t& hash, uint32_t& carry, uint32_t& total_length);
498 EPrimitiveType m_generic;
499 bool m_load_pre_called;
500 bool m_load_post_called;
501 bool m_save_pre_called;
502 bool m_save_post_called;
505 #endif // __SGOBJECT_H__
virtual const char * get_name() const =0
SGStringList< char > get_modelsel_names()
Parallel * get_global_parallel()
virtual bool save_serializable(CSerializableFile *file, const char *prefix="", int32_t param_version=Version::get_version_parameter())
Class that holds informations about a certain parameter of an CSGObject. Contains name...
Class SGRefObject is a reference count based memory management class.
ParameterMap * m_parameter_map
virtual TParameter * migrate(DynArray< TParameter * > *param_base, const SGParamInfo *target)
virtual CSGObject * clone()
virtual CSGObject * deep_copy() const
Class ShogunException defines an exception which is thrown whenever an error inside of shogun occurs...
Version * get_global_version()
virtual void save_serializable_pre()
virtual bool is_generic(EPrimitiveType *generic) const
#define SG_NOTIMPLEMENTED
EModelSelectionAvailability
virtual CSGObject * shallow_copy() const
static int32_t get_version_parameter()
Implements a map of ParameterMapElement instances Maps one key to a set of values.
virtual bool update_parameter_hash()
char * get_modsel_param_descr(const char *param_name)
DynArray< TParameter * > * load_file_parameters(const SGParamInfo *param_info, int32_t file_version, CSerializableFile *file, const char *prefix="")
Class SGObject is the base class of all shogun objects.
void build_gradient_parameter_dictionary(CMap< TParameter *, CSGObject * > *dict)
virtual bool equals(CSGObject *other, float64_t accuracy=0.0)
Template Dynamic array class that creates an array that can be used like a list or an array...
virtual bool load_serializable(CSerializableFile *file, const char *prefix="", int32_t param_version=Version::get_version_parameter())
DynArray< TParameter * > * load_all_file_parameters(int32_t file_version, int32_t current_version, CSerializableFile *file, const char *prefix="")
the class CMap, a map based on the hash-table. w: http://en.wikipedia.org/wiki/Hash_table ...
virtual void save_serializable_post()
void print_modsel_params()
Class Version provides version information.
Parameter * m_model_selection_parameters
void set_global_parallel(Parallel *parallel)
virtual void load_serializable_pre()
virtual void load_serializable_post()
Class Parallel provides helper functions for multithreading.
virtual void one_to_one_migration_prepare(DynArray< TParameter * > *param_base, const SGParamInfo *target, TParameter *&replacement, TParameter *&to_migrate, char *old_name=NULL)
all of classes and functions are contained in the shogun namespace
void map_parameters(DynArray< TParameter * > *param_base, int32_t &base_version, DynArray< const SGParamInfo * > *target_param_infos)
index_t get_modsel_param_index(const char *param_name)
void set_global_io(SGIO *io)
Class SGIO, used to do input output operations throughout shogun.
Parameter * m_gradient_parameters
virtual void print_serializable(const char *prefix="")
void set_global_version(Version *version)
template class SGStringList