# Sorting an Observation Matrix

`in the Summary Statistics section of [MKLMan].Storage format of matrix of observations, order statistics and matrix of sorted observations`

`xp`

`elements, where:n`

is the dimension of the taskpis the number of observationsn

#define DIM 3 /* dimension of the task */ #define N 10 /* number of observations */ int main() { VSLSSTaskPtr task; MKL_INT p, n; MKL_INT x_storage, sorted_x_storage; MKL_INT indices[DIM]={1,1,0}; /* the first two vector components are processed */ double x[DIM][N]; /* matrix of observations */ double y[DIM][N]; /* sorted matrix of observations */ int status; /* Parameters of the task and initialization */ n = N; p = DIM; x_storage = VSL_SS_MATRIX_STORAGE_ROWS; sorted_x_storage = VSL_SS_MATRIX_STORAGE_ROWS; /* Create a task */ status = vsldSSNewTask(&task, &p, &n, &x_storage, (double *)x, 0, indices); /* Initialize the task parameters*/ status = vsldSSEditTask(task, VSL_SS_ED_SORTED_OBSERV, y); status = vsliSSEditTask(task, VSL_SS_ED_SORTED_OBSERV_STORAGE, &sorted_x_storage); /* Sort the observation matrix using the radix method **/ status = vsldSSCompute(task, VSL_SS_SORTED_OBSERV, VSL_SS_METHOD_RADIX); /* Deallocate the task resources */ status = vslSSDeleteTask(&task); return 0; }