Stan  2.14.0
probability, sampling & optimization
expr_type.hpp
Go to the documentation of this file.
1 #ifndef STAN_LANG_AST_EXPR_TYPE_HPP
2 #define STAN_LANG_AST_EXPR_TYPE_HPP
3 
5 #include <cstddef>
6 
7 namespace stan {
8  namespace lang {
9 
14  struct expr_type {
19 
23  std::size_t num_dims_;
24 
28  expr_type();
29 
36  expr_type(const base_expr_type base_type); // NOLINT(runtime/explicit)
37 
45  expr_type(const base_expr_type base_type,
46  std::size_t num_dims);
47 
56  bool operator==(const expr_type& et) const;
57 
65  bool operator!=(const expr_type& et) const;
66 
78  bool operator<(const expr_type& et) const;
79 
87  bool operator<=(const expr_type& et) const;
88 
96  bool operator>(const expr_type& et) const;
97 
105  bool operator>=(const expr_type& et) const;
106 
114  bool is_primitive() const;
115 
123  bool is_primitive_int() const;
124 
132  bool is_primitive_double() const;
133 
139  bool is_ill_formed() const;
140 
146  bool is_void() const;
147 
153  base_expr_type type() const;
154 
160  std::size_t num_dims() const;
161  };
162 
163  }
164 }
165 #endif
bool is_primitive_int() const
Return true if this expression type is an integer type with zero dimensions.
bool is_ill_formed() const
Return true if the base type of this type is ill formed.
std::size_t num_dims_
The number of array dimensions.
Definition: expr_type.hpp:23
Probability, optimization and sampling library.
bool operator<=(const expr_type &et) const
Return true if this expression type is less than or equal to the specified expression type...
std::size_t num_dims() const
Return the number of dimensions for this type.
bool operator<(const expr_type &et) const
Return true if this expression type is less than the specified expression type.
bool is_primitive_double() const
Return true if this expression type is a real type with zero dimensions.
int base_expr_type
The type of a base expression.
Structure of the type of an expression, which consists of a base type and a number of dimensions...
Definition: expr_type.hpp:14
bool operator!=(const expr_type &et) const
Return true if this expression type is not equal to the specified expression type.
bool operator>(const expr_type &et) const
Return true if this expression type is greater than the specified expression type.
base_expr_type type() const
Return the base type of this expression type.
expr_type()
Construct an empty expression type.
bool operator>=(const expr_type &et) const
Return true if this expression type is greater than or equal to the specified expression type...
base_expr_type base_type_
The base expression type.
Definition: expr_type.hpp:18
bool is_primitive() const
Return true if this expression type is an integer or real type with zero dimensions.
bool is_void() const
Return true if this type is void.
bool operator==(const expr_type &et) const
Return true if the specified expression type is equal to this expression type in the sense of having ...

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