Stan  2.14.0
probability, sampling & optimization
has_rng_suffix_def.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_FUN_HAS_RNG_SUFFIX_DEF_HPP
2 #define STAN_LANG_AST_FUN_HAS_RNG_SUFFIX_DEF_HPP
3 
4 #include <stan/lang/ast.hpp>
5 #include <string>
6 
7 namespace stan {
8  namespace lang {
9 
10  bool has_rng_suffix(const std::string& s) {
11  int n = s.size();
12  return n > 4
13  && s[n-1] == 'g'
14  && s[n-2] == 'n'
15  && s[n-3] == 'r'
16  && s[n-4] == '_';
17  }
18 
19  }
20 }
21 #endif
Probability, optimization and sampling library.
bool has_rng_suffix(const std::string &name)
Return true if the specified string has the suffix "_rng".

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