Stan  2.10.0
probability, sampling & optimization
index.hpp
Go to the documentation of this file.
1 #ifndef STAN_MODEL_INDEXING_INDEX_HPP
2 #define STAN_MODEL_INDEXING_INDEX_HPP
3 
4 #include <vector>
5 
6 namespace stan {
7 
8  namespace model {
9 
10  // SINGLE INDEXING (reduces dimensionality)
11 
17  struct index_uni {
18  int n_;
19 
25  explicit index_uni(int n)
26  : n_(n) {
27  }
28  };
29 
30 
31 
32  // MULTIPLE INDEXING (does not reduce dimensionality)
33 
34 
39  struct index_multi {
40  std::vector<int> ns_;
41 
47  explicit index_multi(const std::vector<int>& ns) : ns_(ns) { }
48  };
49 
50 
55  struct index_omni {
56  };
57 
58 
63  struct index_min {
64  int min_;
65 
71  explicit index_min(int min) : min_(min) { }
72  };
73 
74 
79  struct index_max {
80  int max_;
81 
88  explicit index_max(int max) : max_(max) { }
89  };
90 
91 
92 
97  struct index_min_max {
98  int min_;
99  int max_;
100 
108  explicit index_min_max(int min, int max) : min_(min), max_(max) { }
109  };
110 
111  }
112 }
113 #endif
index_min(int min)
Construct an indexing from the specified minimum index (inclusive).
Definition: index.hpp:71
index_max(int max)
Construct an indexing from the start of the container up to the specified maximum index (inclusive)...
Definition: index.hpp:88
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
index_uni(int n)
Construct a single indexing from the specified index.
Definition: index.hpp:25
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
Structure for an indexing consisting of a single index.
Definition: index.hpp:17
index_min_max(int min, int max)
Construct an indexing from the specified minimum index (inclusive) and maximum index (inclusive)...
Definition: index.hpp:108
index_multi(const std::vector< int > &ns)
Construct a multiple indexing from the specified indexes.
Definition: index.hpp:47

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