[18a63e]: src / modules / mix / mix.cc Maximize Restore History

Download this file

mix.cc    46 lines (34 with data), 887 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <module/Module.h>
#include <distributions/DNormMix.h>
#include <distributions/DBetaBin.h>
#include <samplers/MixSamplerFactory.h>
#include <samplers/DirichletCatFactory.h>
#include <samplers/LDAFactory.h>
using std::vector;
namespace jags {
namespace mix {
class MIXModule : public Module {
public:
MIXModule();
~MIXModule();
};
MIXModule::MIXModule()
: Module("mix") {
insert(new DBetaBin);
insert(new DNormMix);
insert(new MixSamplerFactory);
insert(new DirichletCatFactory);
insert(new LDAFactory);
}
MIXModule::~MIXModule() {
vector<Distribution*> const &dvec = distributions();
for (unsigned int i = 0; i < dvec.size(); ++i) {
delete dvec[i];
}
vector<SamplerFactory*> const &svec = samplerFactories();
for (unsigned int i = 0; i < svec.size(); ++i) {
delete svec[i];
}
}
}}
jags::mix::MIXModule _mix_module;