Public Function InversePermutation( _ ByVal vString As Variant _ ) As Variant
InversePermutation("24315") = "41325" InversePermutation("68759") = "85769"See also:
TranspositionOfOrder FunctionSummary: Function assumes that the string vString represent a permutation where the ASCII value of each character represents the number of the item (relative to the minimum ASCII value of the string plus one) and the character position represents sequence of the item within the permutation. In the inverse permutation, the ASCII value of each character represents the sequence of the item and the position of the character represents number of the item. For example, the vString value "24315" represents a permutation of five items with those items in the following order: item #2, item #4, item #3, item #1, item #5. The inverse permutation of that string is "41325" which represents that the sequence within the permutation of item #1 is 4, item #2 is 1, item #3 is 3, item #4 is 2, and item #5 is 5.
vString: String containing the characters which each represent the number of a distinct item in a permutation. Function returns Null if vString is Null or cannot be fixed up to a String.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.