naginterfaces.library.sort.cmplxvec_​rank_​rearrange

naginterfaces.library.sort.cmplxvec_rank_rearrange(cv, m1, irank)[source]

cmplxvec_rank_rearrange rearranges a vector of complex numbers into the order specified by a vector of ranks.

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

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/m01/m01edf.html

Parameters
cvcomplex, array-like, shape

Elements to of must contain complex 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 must 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
cvcomplex, 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.

cmplxvec_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, cmplxvec_rank_rearrange can be called to rearrange a vector of complex 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 cmplxvec_rank_rearrange is called.