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

Functions

template<domain D :shared3p >
D bool sort (D bool[[1]] arr)
 
template<domain D :shared3p , type T>
D T sort (D T[[1]] vec)
 

Detailed Description

Function for sorting values in a vector.

Note
D - shared3p protection domain
Returns
returns a sorted vector from smaller to bigger values
Leakage
Shuffled reordering decisions are declassified
Leaks the number of equal elements

Function Documentation

◆ sort() [1/2]

D bool sort ( D bool[[1]]  arr)
Note
Supported types - bool
boolean values are sorted after their numerical value. false first then true
Parameters
arr- a 1-dimensonal boolean vector

◆ sort() [2/2]

D T sort ( D T[[1]]  vec)
Note
T - any data type
Parameters
vec- a 1-dimensonal supported type vector