Stan  2.14.0
probability, sampling & optimization
promote_primitive_def.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_FUN_PROMOTE_PRIMITIVE_DEF_HPP
2 #define STAN_LANG_AST_FUN_PROMOTE_PRIMITIVE_DEF_HPP
3 
6 
7 namespace stan {
8  namespace lang {
9 
11  if (!et.is_primitive())
12  return expr_type();
13  return et;
14  }
15 
17  const expr_type& et2) {
18  if (!et1.is_primitive() || !et2.is_primitive())
19  return expr_type();
20  return et1.type() == DOUBLE_T ? et1 : et2;
21  }
22 
23  }
24 }
25 #endif
Probability, optimization and sampling library.
const int DOUBLE_T
Real scalar type.
Structure of the type of an expression, which consists of a base type and a number of dimensions...
Definition: expr_type.hpp:14
base_expr_type type() const
Return the base type of this expression type.
expr_type promote_primitive(const expr_type &et)
bool is_primitive() const
Return true if this expression type is an integer or real type with zero dimensions.

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