Stan  2.14.0
probability, sampling & optimization
has_var_def.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_FUN_HAS_VAR_DEF_HPP
2 #define STAN_LANG_AST_FUN_HAS_VAR_DEF_HPP
3 
4 #include <stan/lang/ast.hpp>
5 #include <boost/variant/apply_visitor.hpp>
6 
7 namespace stan {
8  namespace lang {
9 
10  bool has_var(const expression& e, const variable_map& var_map) {
11  has_var_vis vis(var_map);
12  return boost::apply_visitor(vis, e.expr_);
13  }
14 
15  }
16 }
17 #endif
Probability, optimization and sampling library.
A map from function names to their base declarations and their origin.
Visitor to detect if an expression contains a non-data variable.
Definition: has_var_vis.hpp:28
bool has_var(const expression &e, const variable_map &var_map)
Returns true if the specified expression contains a variable that is defined as a parameter...
Definition: has_var_def.hpp:10

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