SHOGUN  6.1.3
init.h
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) 2009 Soeren Sonnenburg
8  * Copyright (C) 2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef __SG_INIT_H__
12 #define __SG_INIT_H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <functional>
17 #include <stdio.h>
18 
19 namespace shogun
20 {
21  class SGIO;
22  class CMath;
23  class Version;
24  class Parallel;
25  class CRandom;
26  class SGLinalg;
27  class CSignal;
28 
45  void init_shogun(
46  const std::function<void(FILE*, const char*)> print_message = nullptr,
47  const std::function<void(FILE*, const char*)> print_warning = nullptr,
48  const std::function<void(FILE*, const char*)> print_error = nullptr);
49 
52 
55  void exit_shogun();
56 
61  void set_global_io(SGIO* io);
62 
67  SGIO* get_global_io();
68 
73  void set_global_parallel(Parallel* parallel);
74 
79  Parallel* get_global_parallel();
80 
85  void set_global_version(Version* version);
86 
91  Version* get_global_version();
92 
97  void set_global_math(CMath* math);
98 
103  CMath* get_global_math();
104 
109  void set_global_rand(CRandom* rand);
110 
115  CRandom* get_global_rand();
116 
117 #ifndef SWIG // SWIG should skip this part
118 
122 SGLinalg* get_global_linalg();
123 #endif
124 
129 CSignal* get_global_signal();
130 
133 void init_from_env();
134 
136 extern std::function<void(FILE*, const char*)> sg_print_message;
137 
139 extern std::function<void(FILE*, const char*)> sg_print_warning;
140 
142 extern std::function<void(FILE*, const char*)> sg_print_error;
143 }
144 #endif //__SG_INIT__
std::function< void(FILE *, const char *)> sg_print_message(nullptr)
function called to print normal messages
Definition: init.cpp:52
void set_global_version(Version *version)
Definition: init.cpp:163
void set_global_math(CMath *math)
Definition: init.cpp:176
void exit_shogun()
Definition: init.cpp:113
void init_shogun_with_defaults()
Definition: init.cpp:107
std::function< void(FILE *, const char *)> sg_print_warning(nullptr)
function called to print warning messages
Definition: init.cpp:55
std::function< void(FILE *, const char *)> sg_print_error(nullptr)
function called to print error messages
Definition: init.cpp:58
void init_shogun(const std::function< void(FILE *, const char *)> print_message, const std::function< void(FILE *, const char *)> print_warning, const std::function< void(FILE *, const char *)> print_error)
Definition: init.cpp:60
CMath * get_global_math()
Definition: init.cpp:183
CSignal * get_global_signal()
Definition: init.cpp:202
Parallel * get_global_parallel()
Definition: init.cpp:157
SGIO * get_global_io()
Definition: init.cpp:144
void set_global_parallel(Parallel *parallel)
Definition: init.cpp:150
SGLinalg * get_global_linalg()
Definition: init.cpp:208
void init_from_env()
Definition: init.cpp:214
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
Version * get_global_version()
Definition: init.cpp:170
void set_global_rand(CRandom *rand)
Definition: init.cpp:189
void set_global_io(SGIO *io)
Definition: init.cpp:137
CRandom * get_global_rand()
Definition: init.cpp:196

SHOGUN Machine Learning Toolbox - Documentation