Stan  2.14.0
probability, sampling & optimization
is_user_defined_prob_function_def.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_FUN_IS_USER_DEFINED_PROB_FUNCTION_DEF_HPP
2 #define STAN_LANG_AST_FUN_IS_USER_DEFINED_PROB_FUNCTION_DEF_HPP
3 
4 #include <stan/lang/ast.hpp>
5 #include <string>
6 #include <vector>
7 
8 namespace stan {
9  namespace lang {
10 
11  bool is_user_defined_prob_function(const std::string& name,
12  const expression& variate,
13  const std::vector<expression>& params) {
14  std::vector<expression> variate_params;
15  variate_params.push_back(variate);
16  for (size_t i = 0; i < params.size(); ++i)
17  variate_params.push_back(params[i]);
18  return is_user_defined(name, variate_params);
19  }
20 
21  }
22 }
23 #endif
Probability, optimization and sampling library.
bool is_user_defined_prob_function(const std::string &name, const expression &variate, const std::vector< expression > &params)
Return true if a probability function with the specified name, random variate and parameters is user ...
bool is_user_defined(const fun &fx)
Return true if the specified function was declared in the functions block.

     [ Stan Home Page ] © 2011–2016, Stan Development Team.