Stan  2.14.0
probability, sampling & optimization
has_prob_fun_suffix_def.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_FUN_HAS_PROB_FUN_SUFFIX_DEF_HPP
2 #define STAN_LANG_AST_FUN_HAS_PROB_FUN_SUFFIX_DEF_HPP
3 
4 #include <stan/lang/ast.hpp>
5 #include <string>
6 
7 namespace stan {
8  namespace lang {
9 
10  bool has_prob_fun_suffix(const std::string& fname) {
11  return ends_with("_lpdf", fname) || ends_with("_lpmf", fname)
12  || ends_with("_log", fname);
13  }
14 
15  }
16 }
17 #endif
Probability, optimization and sampling library.
bool has_prob_fun_suffix(const std::string &name)
Return true if the function with the specified name has a suffix indicating it is a probability funct...
bool ends_with(const std::string &suffix, const std::string &s)
Returns true if the specified suffix appears at the end of the specified string.

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