Stan  2.10.0
probability, sampling & optimization
rvalue_index_size.hpp
Go to the documentation of this file.
1 #ifndef STAN_MODEL_INDEXING_RVALUE_INDEX_SIZE_HPP
2 #define STAN_MODEL_INDEXING_RVALUE_INDEX_SIZE_HPP
3 
5 
6 namespace stan {
7 
8  namespace model {
9 
10  // no error checking
11 
19  inline int rvalue_index_size(const index_multi& idx, int size) {
20  return idx.ns_.size();
21  }
22 
31  inline int rvalue_index_size(const index_omni& idx, int size) {
32  return size;
33  }
34 
43  inline int rvalue_index_size(const index_min& idx, int size) {
44  return size - idx.min_ + 1;
45  }
46 
54  inline int rvalue_index_size(const index_max& idx, int size) {
55  return idx.max_;
56  }
57 
65  inline int rvalue_index_size(const index_min_max& idx, int size) {
66  return idx.max_ - idx.min_ + 1;
67  }
68 
69  }
70 }
71 #endif
int rvalue_index_size(const index_multi &idx, int size)
Return size of specified multi-index.
Probability, optimization and sampling library.
Structure for an indexing consisting of multiple indexes.
Definition: index.hpp:39
Structure for an indexing from a minimum index (inclusive) to a maximum index (inclusive).
Definition: index.hpp:97
Structure for an indexing from a minimum index (inclusive) to the end of a container.
Definition: index.hpp:63
Structure for an indexing that consists of all indexes for a container.
Definition: index.hpp:55
std::vector< int > ns_
Definition: index.hpp:40
Structure for an indexing from the start of a container to a specified maximum index (inclusive)...
Definition: index.hpp:79

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