MultiAgentDecisionProcess  Release 0.2.1
IndexTools.h
Go to the documentation of this file.
1 
28 /* Only include this header file once. */
29 #ifndef _INDEXTOOLS_H_
30 #define _INDEXTOOLS_H_ 1
31 
32 /* the include directives */
33 #include <iostream>
34 #include "Globals.h"
35 
37 
40 namespace IndexTools {
42  bool Increment(Index& index, size_t nrElems);
43 
45  bool Increment(std::vector<Index>& indexVec, const std::vector<size_t>& nrElems );
46 
48  Index IndividualToJointIndices(const std::vector<Index>& indices,
49  const std::vector<size_t>& nrElems);
51  Index IndividualToJointIndices(const std::vector<Index>& indices,
52  const std::vector<size_t>& nrElems, size_t n);
55  const std::vector<size_t>& nrElems);
57  Index IndividualToJointIndicesStepSize(const std::vector<Index>& indices,
58  const std::vector<size_t>& step_size);
60  Index IndividualToJointIndicesStepSize(const std::vector<Index>& indices,
61  const size_t * step_size);
65  const size_t * step_size, size_t vec_size);
66 
69  const std::vector<size_t> &step_size, size_t vec_size);
70 
72  std::vector<Index> JointToIndividualIndices(Index jointI,
73  const std::vector<size_t>& nrElems );
76  std::vector<Index> JointToIndividualIndicesStepSize(Index jointI,
77  const size_t * stepSize, size_t vec_size ) ;
80  std::vector<Index> JointToIndividualIndicesStepSize(
81  Index jointI,
82  const std::vector<size_t> &stepSize,
83  size_t vec_size
84  ) ;
85 
86  std::vector<Index> JointToIndividualIndicesStepSize(
87  Index jointI,
88  const std::vector<size_t> &stepSize
89  );
97  const size_t * stepSize, size_t vec_size ) ;
98 
102  size_t * CalculateStepSize(const std::vector<size_t>& nrElems);
107  size_t * CalculateStepSize(const std::vector<size_t>& nrElems, size_t n);
108 
109  // LIndex versions of all functions
110 
112  bool Increment(LIndex& index, LIndex& nrElems );
114  bool Increment(std::vector<LIndex>& indexVec, std::vector<LIndex>& nrElems );
115 
117  LIndex IndividualToJointIndices(const std::vector<LIndex>& indices,
118  const std::vector<LIndex>& nrElems) ;
121  const std::vector<LIndex>& nrElems);
123  LIndex IndividualToJointIndicesStepSize(const std::vector<LIndex>& indices,
124  const std::vector<LIndex>& step_size) ;
126  LIndex IndividualToJointIndicesStepSize(const std::vector<LIndex>& indices,
127  const LIndex * step_size) ;
130  const LIndex * step_size, LIndex vec_size);
133  const std::vector<LIndex> &step_size, LIndex vec_size);
136  LIndex jointI,
137  const LIndex * stepSize, LIndex vec_size ) ;
139  std::vector<LIndex> JointToIndividualIndicesStepSize(LIndex jointI,
140  const LIndex * stepSize, LIndex vec_size ) ;
142  std::vector<LIndex> JointToIndividualIndicesStepSize(LIndex jointI,
143  const std::vector<LIndex> &stepSize, LIndex vec_size ) ;
144  std::vector<LIndex> JointToIndividualIndicesStepSize(LIndex jointI,
145  const std::vector<LIndex> &stepSize);
147  std::vector<LIndex> JointToIndividualIndices(LIndex jointI,
148  const std::vector<LIndex>& nrElems ) ;
150  LIndex * CalculateStepSize(const std::vector<LIndex>& nrElems);
151 
161  Index oI, size_t nrA, size_t nrO);
162 
164  Index ActionObservation_to_ActionIndex(Index aoI, size_t nrA, size_t nrO);
165 
169  Index ActionObservation_to_ObservationIndex(Index aoI, size_t nrA,size_t nrO);
170 
178  size_t CalculateNumberOfSequences(size_t o, size_t seqLength);
179 
180 }
181 
182 #endif /* !_INDEXTOOLS_H_ */
183 
184 // Local Variables: ***
185 // mode:c++ ***
186 // End: ***