A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://accord-framework.net/docs/html/M_Accord_Math_Matrix_Sort__2_2.htm below:

MatrixSortTKey, TValue Method (TKey, TValue)


double[,] matrix =
{
    { 1, 5, 3 },
    { 2, 2, 6 },
    { 1, 3, 4 },
    { 2, 4, 3 },
    { 1, 0, 1 },
};

double[] v = { -3, 1, 0.42 };




double[,] sortedMatrix1 = Matrix.Sort(keys: v, values: matrix);


double[,] expected1 =
{
    { 1, 3, 5 },
    { 2, 6, 2 },
    { 1, 4, 3 },
    { 2, 3, 4 },
    { 1, 1, 0 },
};




double[,] sortedMatrix2 = Matrix.Sort(keys: v, values: matrix, 
    comparer: new GeneralComparer(ComparerDirection.Ascending, useAbsoluteValues: true));


double[,] expected2 =
{
    { 3, 5, 1 },
    { 6, 2, 2 },
    { 4, 3, 1 },
    { 3, 4, 2 },
    { 1, 0, 1 },
};

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4