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.
- Timestamp:
-
Dec 4, 2009, 8:50:45 AM (16 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
-
-
Property
Status
changed from
new
to
closed
-
Property
Resolution
changed from
to
fixed
-
|
initial
|
v1
|
|
| 1 | 1 | I 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 | }}} |
| 6 | 6 | puts in order the matrix mat, however it seems do nothing. |
| 7 | 7 | |