30#ifndef __CONDITIONAL_PDF__
31#define __CONDITIONAL_PDF__
49 template <
typename Var,
typename CondArg>
class ConditionalPdf :
public Pdf<Var>
108 unsigned int _NumConditionalArguments;
110 std::vector<CondArg> _ConditionalArguments;
115 template<
typename Var,
typename CondArg>
118 , _NumConditionalArguments(num_args)
119 , _ConditionalArguments(num_args)
123 template<
typename Var,
typename CondArg>
128 template<
typename Var,
typename CondArg>
134 template<
typename Var,
typename CondArg>
inline unsigned int
137 return _NumConditionalArguments;
140 template<
typename Var,
typename CondArg>
inline void
143 if (numconditionalarguments != _NumConditionalArguments)
145 _NumConditionalArguments = numconditionalarguments;
146 this->_ConditionalArguments.resize(_NumConditionalArguments);
151 template<
typename Var,
typename CondArg>
const std::vector<CondArg>&
154 return _ConditionalArguments;
157 template<
typename Var,
typename CondArg>
void
160 assert (condargs.size() == _NumConditionalArguments);
161 this->_ConditionalArguments = condargs;
164 template<
typename Var,
typename CondArg>
const CondArg&
167 assert( n_argument < _NumConditionalArguments );
169 return _ConditionalArguments[n_argument];
172 template<
typename Var,
typename CondArg>
void
174 const CondArg& argument)
176 assert ( n_argument < _NumConditionalArguments );
178 this->_ConditionalArguments[n_argument]= argument;
Abstract Class representing conditional Pdfs P(x | ...)
virtual void ConditionalArgumentsSet(std::vector< CondArg > ConditionalArguments)
Set the whole list of conditional arguments.
const CondArg & ConditionalArgumentGet(unsigned int n_argument) const
Get the n-th argument of the list.
virtual ~ConditionalPdf()
Destructor.
virtual ConditionalPdf< Var, CondArg > * Clone() const
Clone function.
virtual void NumConditionalArgumentsSet(unsigned int numconditionalarguments)
Set the Number of conditional arguments.
virtual void ConditionalArgumentSet(unsigned int n_argument, const CondArg &argument)
Set the n-th argument of the list.
unsigned int NumConditionalArgumentsGet() const
Get the Number of conditional arguments.
const std::vector< CondArg > & ConditionalArgumentsGet() const
Get the whole list of conditional arguments.
ConditionalPdf(int dimension=0, unsigned int num_conditional_arguments=0)
Constructor.