SecreC 2 language 2.9.0 (2026.10)
Language and standard library reference
Loading...
Searching...
No Matches
Functions

Functions

template<domain D :shared3p >
uint unsafeSort (D bool vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D xor_uint8 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D xor_uint16 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D xor_uint32 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D xor_uint64 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D uint8 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D uint16 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D uint32 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D uint64 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D int8 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D int16 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D int32 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D int64 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D float32 vec, D xor_uint64 indices, bool ascending)
 
template<domain D :shared3p >
uint unsafeSort (D float64 vec, D xor_uint64 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]

template<domain D :shared3p >
uint unsafeSort ( D bool  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [2/15]

template<domain D :shared3p >
uint unsafeSort ( D float32  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [3/15]

template<domain D :shared3p >
uint unsafeSort ( D float64  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [4/15]

template<domain D :shared3p >
uint unsafeSort ( D int16  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [5/15]

template<domain D :shared3p >
uint unsafeSort ( D int32  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [6/15]

template<domain D :shared3p >
uint unsafeSort ( D int64  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [7/15]

template<domain D :shared3p >
uint unsafeSort ( D int8  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [8/15]

template<domain D :shared3p >
uint unsafeSort ( D uint16  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [9/15]

template<domain D :shared3p >
uint unsafeSort ( D uint32  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [10/15]

template<domain D :shared3p >
uint unsafeSort ( D uint64  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [11/15]

template<domain D :shared3p >
uint unsafeSort ( D uint8  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [12/15]

template<domain D :shared3p >
uint unsafeSort ( D xor_uint16  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [13/15]

template<domain D :shared3p >
uint unsafeSort ( D xor_uint32  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [14/15]

template<domain D :shared3p >
uint unsafeSort ( D xor_uint64  vec,
D xor_uint64  indices,
bool  ascending 
)

◆ unsafeSort() [15/15]

template<domain D :shared3p >
uint unsafeSort ( D xor_uint8  vec,
D xor_uint64  indices,
bool  ascending 
)