14 std::vector<int> range;
15 for (
int i = start; i < start + size; i++) {
22 static std::vector<double>
getRange(
int start,
int size,
double dx,
double ox = 0) {
24 std::vector<double> range;
25 for (
int i : index_range) {
26 range.push_back(i * dx + ox);
37 if (a_J <= 0 || a_I <= 0) {
39 ss <<
"Can't initialze index with 0 offset: " << a_J <<
" " << a_I;
40 throw std::domain_error(ss.str());
45 if (j < 0 || j >
J_) {
47 ss <<
"J: " << j <<
" out of scope : " <<
J_ << std::endl;
48 throw std::domain_error(ss.str());
60 idx3(
int a_K,
int a_J,
int a_I):
64 if (a_K <= 0 || a_J <= 0 || a_I <= 0) {
66 ss <<
"Can't initialze index with 0 offset: " << a_K <<
" " << a_J <<
" " << a_I;
67 throw std::domain_error(ss.str());
73 if (i < 0 || i >
I_) {
75 ss <<
"I: " << i <<
" out of scope : " <<
I_ << std::endl;
76 throw std::domain_error(ss.str());
79 if (j < 0 || j >
J_) {
81 ss <<
"J: " << j <<
" out of scope : " <<
J_ << std::endl;
82 throw std::domain_error(ss.str());
85 if (k < 0 || k >
K_) {
87 ss <<
"K: " << k <<
" out of scope : " <<
K_ << std::endl;
88 throw std::domain_error(ss.str());
91 return k *
J_ *
I_ + j *
I_ + i;
102 idx4(
int a_L,
int a_K,
int a_J,
int a_I):
111 if (i < 0 || i >
I_) {
112 std::stringstream ss;
113 ss <<
"I: " << i <<
" out of scope : " <<
I_ << std::endl;
114 throw std::domain_error(ss.str());
117 if (j < 0 || j >
J_) {
118 std::stringstream ss;
119 ss <<
"J: " << j <<
" out of scope : " <<
J_ << std::endl;
120 throw std::domain_error(ss.str());
123 if (k < 0 || k >
K_) {
124 std::stringstream ss;
125 ss <<
"K: " << k <<
" out of scope : " <<
K_ << std::endl;
126 throw std::domain_error(ss.str());
129 if (l < 0 || l >
L_) {
130 std::stringstream ss;
131 ss <<
"L: " << l <<
" out of scope : " <<
L_ << std::endl;
132 throw std::domain_error(ss.str());
147 idx6(
int a_N,
int a_M,
int a_L,
int a_K,
int a_J,
int a_I):
155 int operator()(
int n,
int m,
int l,
int k,
int j,
int i)
const {
157 if (i < 0 || i >
I_) {
158 std::stringstream ss;
159 ss <<
"I: " << i <<
" out of scope : " <<
I_ << std::endl;
160 throw std::domain_error(ss.str());
163 if (j < 0 || j >
J_) {
164 std::stringstream ss;
165 ss <<
"J: " << j <<
" out of scope : " <<
J_ << std::endl;
166 throw std::domain_error(ss.str());
169 if (k < 0 || k >
K_) {
170 std::stringstream ss;
171 ss <<
"K: " << k <<
" out of scope : " <<
K_ << std::endl;
172 throw std::domain_error(ss.str());
175 if (l < 0 || l >
L_) {
176 std::stringstream ss;
177 ss <<
"L: " << l <<
" out of scope : " <<
L_ << std::endl;
178 throw std::domain_error(ss.str());
181 if (m < 0 || m >
M_) {
182 std::stringstream ss;
183 ss <<
"M: " << m <<
" out of scope : " <<
M_ << std::endl;
184 throw std::domain_error(ss.str());
187 if (n < 0 || n >
N_) {
188 std::stringstream ss;
189 ss <<
"N: " << n <<
" out of scope : " <<
N_ << std::endl;
190 throw std::domain_error(ss.str());
207 idx7(
int a_O,
int a_N,
int a_M,
int a_L,
int a_K,
int a_J,
int a_I):
216 int operator()(
int o,
int n,
int m,
int l,
int k,
int j,
int i)
const {
218 if (i < 0 || i >
I_) {
219 std::stringstream ss;
220 ss <<
"I: " << i <<
" out of scope : " <<
I_ << std::endl;
221 throw std::domain_error(ss.str());
224 if (j < 0 || j >
J_) {
225 std::stringstream ss;
226 ss <<
"J: " << j <<
" out of scope : " <<
J_ << std::endl;
227 throw std::domain_error(ss.str());
230 if (k < 0 || k >
K_) {
231 std::stringstream ss;
232 ss <<
"K: " << k <<
" out of scope : " <<
K_ << std::endl;
233 throw std::domain_error(ss.str());
236 if (l < 0 || l >
L_) {
237 std::stringstream ss;
238 ss <<
"L: " << l <<
" out of scope : " <<
L_ << std::endl;
239 throw std::domain_error(ss.str());
242 if (m < 0 || m >
M_) {
243 std::stringstream ss;
244 ss <<
"M: " << m <<
" out of scope : " <<
M_ << std::endl;
245 throw std::domain_error(ss.str());
248 if (n < 0 || n >
N_) {
249 std::stringstream ss;
250 ss <<
"N: " << n <<
" out of scope : " <<
N_ << std::endl;
251 throw std::domain_error(ss.str());
254 if (o < 0 || o >
O_) {
255 std::stringstream ss;
256 ss <<
"O: " << o <<
" out of scope : " <<
O_ << std::endl;
257 throw std::domain_error(ss.str());
261 + k *
J_ *
I_ + j *
I_ + i;