SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NormalSampler.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) 2013 Soumyajit De
8  */
9 
10 #include <shogun/lib/common.h>
11 #include <shogun/lib/SGVector.h>
14 
15 namespace shogun
16 {
17 
19  : CTraceSampler()
20 {
21  SG_GCDEBUG("%s created (%p)\n", this->get_name(), this)
22 }
23 
25  : CTraceSampler(dimension)
26 {
27  SG_GCDEBUG("%s created (%p)\n", this->get_name(), this)
28 }
29 
31 {
32  SG_GCDEBUG("%s destroyed (%p)\n", this->get_name(), this)
33 }
34 
36 {
37  m_num_samples=1;
38 }
39 
41 {
42  // ignore idx since it doesnt matter, all samples are independent
44 
45  for (index_t i=0; i<m_dimension; ++i)
47 
48  return s;
49 }
50 
51 }
float64_t std_normal_distrib() const
Definition: Random.cpp:238
int32_t index_t
Definition: common.h:62
CRandom * sg_rand
Definition: init.cpp:39
#define SG_GCDEBUG(...)
Definition: SGIO.h:102
virtual const char * get_name() const
Definition: NormalSampler.h:46
virtual void precompute()
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
Abstract template base class that provides an interface for sampling the trace of a linear operator u...
Definition: TraceSampler.h:23
virtual SGVector< float64_t > sample(index_t idx) const

SHOGUN Machine Learning Toolbox - Documentation