nag_reorder_vector (m01esc) rearranges a vector of arbitrary type data objects into the order specified by a vector of indices.
nag_reorder_vector (m01esc) uses a variant of list merging as described by
Knuth (1973). The function rearranges a set of
data objects of arbitrary type, which are stored in an array at intervals of length
stride, into the order specified by an array of indices.
- NE_2_INT_ARG_LT
-
On entry, while . These arguments must satisfy .
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
- NE_BAD_RANK
-
- NE_INT_ARG_GT
-
On entry, .
Constraint: , an implementation-dependent size that is printed in the error message.
On entry, .
Constraint: , an implementation-dependent size that is printed in the error message.
On entry, .
Constraint: , an implementation-dependent size that is printed in the error message.
- NE_INT_ARG_LT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
Not applicable.
nag_reorder_vector (m01esc) is not threaded in any implementation.
The average time taken by the function is approximately proportional to
n.
The example program.