Stan  2.14.0
probability, sampling & optimization
get_prob_fun_def.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_FUN_GET_PROB_FUN_DEF_HPP
2 #define STAN_LANG_AST_FUN_GET_PROB_FUN_DEF_HPP
3 
4 #include <stan/lang/ast.hpp>
5 #include <string>
6 
7 namespace stan {
8  namespace lang {
9 
10  std::string get_prob_fun(const std::string& dist_name) {
11  if (function_signatures::instance().has_key(dist_name + "_log"))
12  return dist_name + "_log";
13  else if (function_signatures::instance().has_key(dist_name + "_lpdf"))
14  return dist_name + "_lpdf";
15  else if (function_signatures::instance().has_key(dist_name + "_lpmf"))
16  return dist_name + "_lpmf";
17  else
18  return dist_name;
19  }
20 
21  }
22 }
23 #endif
Probability, optimization and sampling library.
std::string get_prob_fun(const std::string &dist_name)
Return the probability function (density or mass) for the specified distribution name.
static function_signatures & instance()
Return the instance of this singleton.

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