A .inv( p )

Read(206) Label: adjust, order of member,

Description:

Adjust the order of members of a sequence.

Syntax:

A.inv(p)

Note:

The function adjusts the order of members of A according to the integer sequence p, whose members are ranks of members of sequence A, and return the new A.

Parameters:

p

An integer sequence, whose members are ranks of members of A. So the number of its members is the same as that of members of A, and it is a unique n-integer sequence (n=A.len()).

A

A sequence or a record sequence.

Return value:

The adjusted sequence

Example:

 

A

 

1

[b,c,a,d]

 

2

=A1.inv([2,3,1,4])

[a,b,c,d]

Note:

p must be a unique n-integer sequence, i.e. n must be equal to A.len()

If p has duplicate members or the number of its members is not equal to that of members of A, return null.

If the maximum member value of p exceeds the maximum sequence number of A, return null

The members of tied ranks will be ignored

Related functions:

p.inv(k)