/usr/include/JAGS/sampler/SingletonFactory.h is in jags 4.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | #ifndef SINGLETON_FACTORY_H_
#define SINGLETON_FACTORY_H_
#include <sampler/SamplerFactory.h>
namespace jags {
/**
* @short Factory object for a Sampler that samples a single node
*
* Many Sampler objects update a singe StochasticNode (and its
* deterministic descendants). This is a convenience class designed
* to make it easier to create a factory object for such samplers.
*/
class SingletonFactory : public SamplerFactory
{
public:
/**
* Determines whether the factory can produce a Sampler for the
* given node, within the given graph. This function is called
* by SingletonFactory#makeSamplers
*/
virtual bool canSample(StochasticNode *node, Graph const &graph)
const = 0;
/**
* Returns a dynamically allocated Sampler for a given node. This
* function is called by SingletonFactory#makeSamplers.
*/
virtual Sampler *makeSampler(StochasticNode *node,
Graph const &graph) const = 0;
/**
* This traverses the list of available nodes, creating a Sampler,
* when possible, for each individual StochasticNode.
*/
std::vector<Sampler*> makeSamplers(std::list<StochasticNode*> const &nodes,
Graph const &graph) const;
};
} /* namespace jags */
#endif /* SINGLETON_FACTORY_H */
|