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

Functions

template<domain D :shared3p >
D bool sort (D bool matrix, uint column)
 
template<domain D :shared3p , type T>
D T sort (D T matrix, uint column)
 

Detailed Description

Function for sorting rows of a matrix based on values of a column.

Note
D - shared3p protection domain
Returns
returns a matrix where the input matrix rows are sorted based on values of the specified column
Leakage
Shuffled reordering decisions are declassified
Leaks the number of equal elements

Function Documentation

◆ sort() [1/2]

template<domain D :shared3p >
D bool sort ( D bool  matrix,
uint  column 
)
Note
Supported types - bool
boolean values are sorted after their numerical value. false first then true
Parameters
column- index of the column used for ordering
matrix- a matrix of supported type

◆ sort() [2/2]

template<domain D :shared3p , type T>
D T sort ( D T  matrix,
uint  column 
)
Note
T - any data type
Parameters
column- index of the column used for ordering
matrix- a matrix of supported type