Stan  2.14.0
probability, sampling & optimization
conditional_op_def.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_NODE_CONDITIONAL_OP_DEF_HPP
2 #define STAN_LANG_AST_NODE_CONDITIONAL_OP_DEF_HPP
3 
4 #include <stan/lang/ast.hpp>
5 
6 namespace stan {
7  namespace lang {
8 
10 
12  const expression& true_val,
13  const expression& false_val)
14  : cond_(cond),
15  true_val_(true_val),
16  false_val_(false_val),
17  type_(promote_primitive(true_val.expression_type(),
18  false_val.expression_type())) {
19  }
20 
21  }
22 }
23 #endif
Probability, optimization and sampling library.
conditional_op()
Construct a default conditional operator expression.
expression cond_
Condition (integer).
expression true_val_
Return value if condition is true.
expr_type promote_primitive(const expr_type &et)
expression false_val_
Return value if condition is false.
expr_type type_
Type of result.

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