naginterfaces.library.sort.intvec_​rank_​rearrange

naginterfaces.library.sort.intvec_rank_rearrange(iv, m1, irank)[source]

intvec_rank_rearrange rearranges a vector of integer numbers into the order specified by a vector of ranks.

For full information please refer to the NAG Library document for m01eb

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/m01/m01ebf.html

Parameters
ivint, array-like, shape

Elements to of must contain integer values to be rearranged.

m1int

Note: this argument represents an array index; the value you supply must be base-1 for compatibility with the NAG Engine.

and specify the range of the ranks supplied in and the elements of to be rearranged.

irankint, array-like, shape

Elements to of must contain a permutation of the integers to , which are interpreted as a vector of ranks.

Returns
ivint, ndarray, shape

These values are rearranged into rank order. For example, if , then the initial value of is moved to .

irankint, ndarray, shape

Used as internal workspace prior to being restored and hence is unchanged.

Raises
NagValueError
(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

does not contain a permutation of the integers to . contains an out-of-range value: , .

(errno )

does not contain a permutation of the integers to . contains a repeated value: .

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

intvec_rank_rearrange is designed to be used typically in conjunction with the ranking functions realvec_rank(), intvec_rank(), charvec_rank(), realmat_rank_rows(), intmat_rank_rows(), realmat_rank_columns(), intmat_rank_columns() and arbitrary_rank(). After one of those functions has been called to determine a vector of ranks, intvec_rank_rearrange can be called to rearrange a vector of integer numbers into the rank order. If the vector of ranks has been generated in some other way, then permute_check() should be called to check its validity before intvec_rank_rearrange is called.