SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions

Functions

template<domain D :shared3p >
uint unsafeSort (D bool[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D xor_uint8[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D xor_uint16[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D xor_uint32[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D xor_uint64[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D uint8[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D uint16[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D uint32[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D uint64[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D int8[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D int16[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D int32[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D int64[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D float32[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D float64[[1]] vec, D xor_uint64[[1]] indices, bool ascending)
 

Detailed Description

Function for sorting a vector if the vector has been shuffled.

Note
unsafeSort is stable
D - shared3p protection domain
Supported types - uint8 / uint16 / uint32 / uint / int8 / int16 / int32 / int / xor_uint8 / xor_uint16 / xor_uint32 / xor_uint64 / float32 / float64
Parameters
vec- input vector
indices- an index vector indicating which indice an element of the shuffled vector originated from
ascending- a boolean indicating if the vector should be sorted in ascending order
Returns
returns the sort permutation. The ith value of the permutation is the index of the input value that is in the ith position after sorting.
Leakage
Nothing is leaked if the input has been shuffled and the indices are unique
If the input is not shuffled or the indices are not unique, leaks the relative ordering of elements possibly including whether elements are equal

Function Documentation

◆ unsafeSort() [1/15]

uint unsafeSort ( D bool[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [2/15]

uint unsafeSort ( D float32[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [3/15]

uint unsafeSort ( D float64[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [4/15]

uint unsafeSort ( D int16[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [5/15]

uint unsafeSort ( D int32[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [6/15]

uint unsafeSort ( D int64[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [7/15]

uint unsafeSort ( D int8[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [8/15]

uint unsafeSort ( D uint16[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [9/15]

uint unsafeSort ( D uint32[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [10/15]

uint unsafeSort ( D uint64[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [11/15]

uint unsafeSort ( D uint8[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [12/15]

uint unsafeSort ( D xor_uint16[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [13/15]

uint unsafeSort ( D xor_uint32[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [14/15]

uint unsafeSort ( D xor_uint64[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)

◆ unsafeSort() [15/15]

uint unsafeSort ( D xor_uint8[[1]]  vec,
D xor_uint64[[1]]  indices,
bool  ascending 
)