Go to the documentation of this file.
114 T* data_orig =
new T[n];
115 for (
int i = 0;
i < n; ++
i) {
119 for (
int icnt = 0; icnt <
cnt; ++icnt) {
120 for (
int isz = 0; isz < sz; ++isz) {
124 data[ip] = data_orig[
i];
132 int* pinv =
new int[n];
133 for (
int i = 0;
i < n; ++
i) {
141 for (
int i = 0;
i < n; ++
i) {
167 if (pd >= ml->
data && pd < ml->
data + n) {
172 if (type < type_hint) {
187 double* pd = nt.
_data +
i;
199 if (pd >= ml->
data) {
201 if (pd < ml->
data + n) {
232 for (
int i = 0;
i < psz; ++
i) {
233 int s = semantics[
i];
237 for (
int iml = 0; iml <
cnt; ++iml) {
245 int ix = *pd - area0;
247 int ixnew = p_target[ix];
250 }
else if (s == -9) {
253 for (
int iml = 0; iml <
cnt; ++iml) {
261 int ix = *pd - diam0;
263 int ixnew = p_target[ix];
266 }
else if (s == -5) {
269 for (
int iml = 0; iml <
cnt; ++iml) {
277 int ixnew = e_target[ix];
279 }
else if (etype > 0) {
287 int i_ecnt, i_esz, padded_ecnt;
288 int ix = *pd - edata0;
296 i_ecnt = ix % padded_ecnt;
297 i_esz = ix / padded_ecnt;
299 int i_ecnt_new = e_permute ? e_permute[i_ecnt] : i_ecnt;
300 int ix_new =
nrn_i_layout(i_ecnt_new, ecnt, i_esz, esz, elayout);
301 *pd = ix_new + edata0;
306 }
else if (s >= 0 && s < 1000) {
314 for (
int iml = 0; iml <
cnt; ++iml) {
316 int ix = *pd - edata0;
318 int i_ecnt, i_esz, padded_ecnt;
326 i_ecnt = ix % padded_ecnt;
327 i_esz = ix / padded_ecnt;
329 int i_ecnt_new = e_permute[i_ecnt];
330 int ix_new =
nrn_i_layout(i_ecnt_new, ecnt, i_esz, esz, elayout);
331 *pd = ix_new + edata0;
338 for (
int i = 0;
i < n; ++
i) {
373 return p[i_cnt] * sz + i_sz;
377 int i_cnt = ix % padded_cnt;
378 int i_sz = ix / padded_cnt;
379 return i_sz * padded_cnt + p[i_cnt];
384 static void pr(
const char* s,
int* x,
int n) {
386 for (
int i = 0;
i < n; ++
i) {
387 printf(
" %d %d",
i, x[
i]);
392 static void pr(
const char* s,
double* x,
int n) {
394 for (
int i = 0;
i < n; ++
i) {
395 printf(
" %d %g",
i, x[
i]);
407 if (a.first < b.first) {
409 }
else if (a.first == b.first) {
410 if (a.second < b.second) {
418 std::vector<std::pair<int, int>> vi(n);
419 for (
int i = 0;
i < n; ++
i) {
420 vi[
i].first = values[
i];
424 int* sort_indices =
new int[n];
425 for (
int i = 0;
i < n; ++
i) {
426 sort_indices[
i] = vi[
i].second;
auto & get_mech_data_layout()
int type_of_ntdata(NrnThread &nt, int i, bool reset)
static void invert_permute(int *p, int n)
static std::vector< int > type_hints
auto & get_is_artificial()
auto & get_memb_func(size_t idx)
void permute_data(double *vec, int n, int *p)
int nrn_soa_padded_size(int cnt, int layout)
calculate size after padding for specific memory layout
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
static bool nrn_index_sort_cmp(const std::pair< int, int > &a, const std::pair< int, int > &b)
auto & get_prop_dparam_size()
static int full_search(NrnThread &nt, double *pd)
int nrn_index_permute(int ix, int type, Memb_list *ml)
void permute_ptr(int *vec, int n, int *p)
void node_permute(int *vec, int n, int *permute)
void permute_ml(Memb_list *ml, int type, NrnThread &nt)
int nrn_i_layout(int icnt, int cnt, int isz, int sz, int layout)
This function return the index in a flat array of a matrix coordinate (icnt, isz).
static void update_pdata_values(Memb_list *ml, int type, NrnThread &nt)
int * inverse_permute(int *p, int n)
auto & get_prop_param_size()
void permute_nodeindices(Memb_list *ml, int *p)
#define nrn_assert(x)
assert()-like macro, independent of NDEBUG status
static int permute(int i, NrnThread &nt)
static int * nrn_index_sort(int *values, int n)