10:237
     %ˆÈ�þZ«7!�âJÛ1�ÏÇƒÆÅ¿Ã     %#ifndef ARRAY_LOGICAL_NODE_H_
#define ARRAY_LOGICAL_NODE_H_

#include <graph/LogicalNode.h>
#include <vector>

namespace jags {

class ArrayFunction;

/**
 * @short Array-valued Node defined by the BUGS-language operator <-
 */
class ArrayLogicalNode : public LogicalNode {
    ArrayFunction const * const _func;
    std::vector<std::vector<unsigned int> >  _dims;
public:
    /**
     * A logical node is defined by a function (which may be an inline
     * operator in the BUGS language) and its parameters.
     */
    ArrayLogicalNode(ArrayFunction const *func, unsigned int nchain,
		     std::vector<Node const*> const &parameters);
    /**
     * Calculates the value of the node based on the parameters. 
     */
    void deterministicSample(unsigned int chain);
    /**
     * @see ArrayFunction#checkParameterValue.
     */
    bool checkParentValues(unsigned int chain) const;
    //DeterministicNode *clone(std::vector<Node const *> const &parents) const;
};

} /* namespace jags */

#endif /* ARRAY_LOGICAL_NODE_H_ */
     'ˆÈ�þ[ VnB=Ä•¶c ?ŸÇƒN³ÆÅ¿Ã Á    '#ifndef SCALAR_FUNCTION_H_
#define SCALAR_FUNCTION_H_

#include <function/Function.h>

namespace jags {

/**
 * @short Scalar-valued Function with scalar arguments
 *
 * ScalarFunction represents scalar-valued functions whose parameters are
 * also scalars. 
 */
class ScalarFunction : public Function
{
public:
    ScalarFunction(std::string const &name, unsigned int npar);
    /**
     * Evaluates the function and returns the result
     *
     * @param args Vector of arguments
     */
    virtual double evaluate(std::vector <double const *> const &args) const = 0;
    /**
     * Checks that the argument values are in the domain of the function.
     */
    virtual bool 
	checkParameterValue(std::vector<double const *> const &args) const;
    /**
     * Tests whether the function preserves power transformations,
     * i.e.  can be expressed as f(x) = a*b^x for some value of a,b,
     * where a,b, and x are all scalar.
     *
     * The default method returns true if the ScalarFunction preserves
     * scale transformations AND only one element of mask is true.
     * Such functions also preserve fixed power transformations.
     *
     * Note that if a > 0 then a power function is a linear function on
     * the log scale: log(f(x)) = log(a) + log(b) * x.
     *
     * @see Function#isPower
     */
    bool isPower(std::vector<bool> const &mask,
		 std::vector<bool> const &isfixed) const;
};

} /* namespace jags */

#endif /* SCALAR_FUNCTION_H_ */
     )ˆÈ�þ[}µ›��Fñ%m˜ÈçÇƒBÆÅ¿Ã •    )#ifndef ARRAY_STOCHASTIC_NODE_H_
#define ARRAY_STOCHASTIC_NODE_H_

#include <graph/StochasticNode.h>

namespace jags {

class ArrayDist;

/**
 * @short Array-valued Node defined by the BUGS-language operator ~
 */
class ArrayStochasticNode : public StochasticNode {
    ArrayDist const * const _dist;
    std::vector<std::vector<unsigned int> > _dims;
    void sp(double *lower, double *upper, unsigned int length, 
	    unsigned int chain) const;
public:
    /**
     * Construct
     * distribution and an array of parent nodes, considered as
     * parameters to the distribution.
     */
    ArrayStochasticNode(ArrayDist const *dist, unsigned int nchain,
			std::vector<Node const *> const &parameters,
			Node const *lower, Node const *upper,
			double const *data=0, unsigned int length=0);
    double logDensity(unsigned int chain, PDFType type) const;
    void randomSample(RNG *rng, unsigned int chain);
    void truncatedSample(RNG *rng, unsigned int chain,
			 double const *lower, double const *upper);
    void deterministicSample(unsigned int chain);
    bool checkParentValues(unsigned int chain) const;
    //StochasticNode *clone(std::vector<Node const *> const &parents,
    //Node const *lower, Node const *upper) const;
    unsigned int df() const;
    double KL(unsigned int chain1, unsigned int chain2, RNG *rng, unsigned int nrep) const;
};

} /* namespace jags */

#endif /* ARRAY_STOCHASTIC_NODE_H_ */

     +