61 int modifier_num,
int *mstate) {
70 int *workpatch_pos =
xmalloc((
size_t)patch_size *
sizeof(
int));
71 int *extract_pos =
xmalloc((
size_t)patch_size *
sizeof(
int));
78 for (
int im = 0; im < modifier_num; im++) {
90 if (intersection_size > patch_size)
die(
"xt_idxmod_new: internal error: (intersection_size > patch_size)");
99 if (missing)
die(
"xt_idxmod_new: internal error: cannot locate all intersection positions (1)");
108 if (missing)
die(
"xt_idxmod_new: internal error: cannot locate all intersection positions (2)");
115 if (undef_num)
die(
"xt_idxmod_new: internal error: failed access: m->subst is too small");
125 if ( mstate != NULL && mask != 0) {
127 for (
int i=0; i<intersection_size; i++) {
128 p = workpatch_pos[i];
129 workpatch_idx[p] = subst_idx[i];
133 for (
int i=0; i<intersection_size; i++) {
134 p = workpatch_pos[i];
135 workpatch_idx[p] = subst_idx[i];
138 workpatch_idxlist =
xt_idxvec_new(workpatch_idx, patch_size);
148 return workpatch_idxlist;
int xt_idxlist_get_num_indices(Xt_idxlist idxlist)
base definitions header file
add versions of standard API functions not returning on error
void xt_idxlist_get_indices(Xt_idxlist idxlist, Xt_int *indices)
void xt_idxlist_delete(Xt_idxlist idxlist)
Xt_idxlist extract
idx values
int xt_idxlist_get_positions_of_indices(Xt_idxlist idxlist, const Xt_int *indices, int num_indices, int *positions, int single_match_only)
int xt_idxlist_get_indices_at_positions(Xt_idxlist idxlist, const int *positions, int num_pos, Xt_int *indices, Xt_int undef_idx)
Xt_idxlist xt_idxvec_new(const Xt_int *idxlist, int num_indices)
Xt_idxlist xt_idxlist_copy(Xt_idxlist idxlist)
Xt_idxlist xt_idxmod_new(Xt_idxlist patch_idxlist, struct Xt_modifier *modifier, int modifier_num, int *mstate)
generates a new index list based on an index list and a sequence of modifiers
const Xt_int * xt_idxlist_get_indices_const(Xt_idxlist idxlist)
Xt_idxlist xt_idxlist_get_intersection(Xt_idxlist idxlist_src, Xt_idxlist idxlist_dst)