13 #ifndef __SGOBJECT_H__
14 #define __SGOBJECT_H__
34 class CSerializableFile;
36 template <
class T,
class K>
class CMap;
46 #define VA_NARGS_IMPL(_1, _2, _3, _4, _5, N, ...) N
47 #define VA_NARGS(...) VA_NARGS_IMPL(__VA_ARGS__, 5, 4, 3, 2, 1)
49 #define VARARG_IMPL2(base, count, ...) base##count(__VA_ARGS__)
50 #define VARARG_IMPL(base, count, ...) VARARG_IMPL2(base, count, __VA_ARGS__)
51 #define VARARG(base, ...) VARARG_IMPL(base, VA_NARGS(__VA_ARGS__), __VA_ARGS__)
53 #define SG_ADD4(param, name, description, ms_available) {\
54 m_parameters->add(param, name, description);\
56 m_model_selection_parameters->add(param, name, description);\
59 #define SG_ADD5(param, name, description, ms_available, gradient_available) {\
60 m_parameters->add(param, name, description);\
62 m_model_selection_parameters->add(param, name, description);\
63 if (gradient_available)\
64 m_gradient_parameters->add(param, name, description);\
67 #define SG_ADD(...) VARARG(SG_ADD, __VA_ARGS__)
125 virtual const char*
get_name()
const = 0;
135 virtual bool is_generic(EPrimitiveType*
generic)
const;
194 const char* prefix=
"");
209 int32_t current_version,
227 int32_t& base_version,
344 TParameter*& to_migrate,
char* old_name=NULL);
420 void set_global_objects();
421 void unset_global_objects();
429 bool is_param_new(
const SGParamInfo param_info)
const;
446 const char* prefix=
"");
456 void get_parameter_incremental_hash(uint32_t& hash, uint32_t& carry,
457 uint32_t& total_length);
486 EPrimitiveType m_generic;
487 bool m_load_pre_called;
488 bool m_load_post_called;
489 bool m_save_pre_called;
490 bool m_save_post_called;
493 #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())
virtual void update_parameter_hash()
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()
Class ShogunException defines an exception which is thrown whenever an error inside of shogun occurs...
virtual CSGObject * shallow_copy() const
Version * get_global_version()
virtual void save_serializable_pre()
virtual bool is_generic(EPrimitiveType *generic) const
EModelSelectionAvailability
static int32_t get_version_parameter()
Implements a map of ParameterMapElement instances Maps one key to a set of values.
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)
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
virtual bool equals(CSGObject *other, float64_t accuracy=0.0, bool tolerant=false)
virtual CSGObject * deep_copy() const
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)
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="")
virtual bool parameter_hash_changed()
void set_global_version(Version *version)
template class SGStringList