[4634c7]: src / modules / glm / samplers / LinearFactory.cc  Maximize  Restore  History

Download this file

46 lines (36 with data), 1.0 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
#include <config.h>
#include "LinearFactory.h"
#include "Linear.h"
#include "NormalLinear.h"
#include <graph/StochasticNode.h>
#include <distribution/Distribution.h>
#include <sampler/SingletonGraphView.h>
using std::vector;
namespace jags {
namespace glm {
LinearFactory::LinearFactory()
: GLMFactory("glm::Linear")
{
}
bool LinearFactory::checkOutcome(StochasticNode const *snode) const
{
return NormalLinear::canRepresent(snode);
}
GLMMethod*
LinearFactory::newMethod(GraphView const *view,
vector<SingletonGraphView const *> const &subviews,
unsigned int chain) const
{
vector<Outcome*> outcomes;
for (vector<StochasticNode *>::const_iterator p = view->stochasticChildren().begin();
p != view->stochasticChildren().end(); ++p)
{
outcomes.push_back(new NormalLinear(*p, chain));
}
return new Linear(view, subviews, outcomes, chain, false);
}
bool LinearFactory::canSample(StochasticNode const *snode) const
{
return !isBounded(snode);
}
}}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks