Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[4c0f6f]: src / modules / glm / glm.cc Maximize Restore History

Download this file

glm.cc    72 lines (55 with data), 1.6 kB

 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <Module.h>
#include "samplers/LinearFactory.h"
#include "samplers/LinearGibbsFactory.h"
#include "samplers/IWLSFactory.h"
#include "samplers/HolmesHeldFactory.h"
#include "samplers/AlbertChibFactory.h"
#include "samplers/AlbertChibGibbsFactory.h"
#include "samplers/AMFactory.h"
#include "samplers/ConjugateFFactory.h"
#include <cholmod.h>
using std::vector;
cholmod_common *glm_wk = 0; /* Workspace for CHOLMOD */
namespace glm {
class GLMModule : public Module {
public:
GLMModule();
~GLMModule();
};
GLMModule::GLMModule()
: Module("glm")
{
glm_wk = new cholmod_common;
cholmod_start(glm_wk);
//Force use of simplicial factorization. Supernodal factorizations
//have a completely different data structure, although held in
//the same object.
glm_wk->supernodal = CHOLMOD_SIMPLICIAL;
/*
//Force use of LL' factorisation instead of LDL
//glm_wk->final_ll = true;
//For debuggin purposes we may choose not to reorder matrices
//Use only on small problems
glm_wk->nmethods = 1 ;
glm_wk->method [0].ordering = CHOLMOD_NATURAL ;
glm_wk->postorder = 0 ;
*/
insert(new IWLSFactory);
insert(new LinearGibbsFactory);
insert(new LinearFactory);
insert(new AMFactory);
insert(new AlbertChibGibbsFactory);
insert(new AlbertChibFactory);
insert(new HolmesHeldFactory);
insert(new ConjugateFFactory);
}
GLMModule::~GLMModule() {
vector<SamplerFactory*> const &svec = samplerFactories();
for (unsigned int i = 0; i < svec.size(); ++i) {
delete svec[i];
}
cholmod_finish(glm_wk);
delete glm_wk;
}
}
glm::GLMModule _glm_module;