close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Changes between Initial Version and Version 1 of Ticket #793


Ignore:
Timestamp:
Dec 4, 2009, 8:50:45 AM (15 years ago)
Author:
Víctor de Buen Remiro
Comment:

I've checked this function and it's all right. You may want to write this?

  Matrix mat = Rand(100, 1, 0, 30);
  Matrix permutation = Sort(mat, SetOfReal(1));
  Matrix sorted = PivotByRows(mat,permutation);

I think the description of this function could help you

Sort {Matrix Sort(Matrix mat, Set criterium)
  • English: Sorts rows of a matrix given a mixed criterium of ascent or descent columns. For example, criterium=[[-2,3]] sorts by 2-nd column descent and 3-th one ascent in case of tie. Returns the permutation matrix p such that PivotByRows(mat,p) is the sorted matrix.
  • Spanish: Ordena las filas de una matriz dado un criterio mezclado de columnas ascendentes y descendentes. Por ejemplo, criterium=[[-2,3]] ordena por la segunda columna descendente y por la tercera ascendente en caso de empate.Devuelve la matriz de permutación tal que PivotByRows(mat,p) es la matriz ordenada.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #793

    • Property Status changed from new to closed
    • Property Resolution changed from to fixed
  • Ticket #793 – Description

    initial v1  
    11I would expect that 
    2 
    3  Matrix mat  = Rand(100, 1, 0, 30);
    4  Matrix matS = Sort(mat, SetOfReal(1));
    5 
     2{{{
     3  Matrix mat  = Rand(100, 1, 0, 30);
     4  Matrix matS = Sort(mat, SetOfReal(1));
     5}}}
    66puts in order the matrix mat, however it seems do nothing.
    77