This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Matrix sorting
- From: "Rampas, Tomas" <Rampas at gedas dot cz>
- To: "'gsl-discuss at sources dot redhat dot com'" <gsl-discuss at sources dot redhat dot com>
- Date: Fri, 11 Jul 2003 11:42:51 +0200
- Subject: Matrix sorting
Hello,
I have a question about matrix.
I have a gsl_matrix object an I would like to sort that matrix along the
specific column. Is it posible in GSL?
I tried gsl_heapsort and STL qsort but with not success.
My code follows:
gsl_heapsort(matrix->data, matrix->size1, matrix->size2 * sizeof(double),
compare);
int compare( const void *arg1, const void *arg2 )
{
if ((double *)arg1 < (double *)arg2)
return -1;
else if ((double *)arg1 > (double *)arg2)
return 1;
else
return 0;
}
By the code above doesn't sort my matrix object.
Any suggestion would be appreciated.
Tomáš Rampas
---------------------------------------------------------------
gedas ČR s.r.o.
System analyst, MCP
TGM 840, 293 01 Mladá Boleslav, Czech Republic
Telefon/phone +420-326-711-411
Telefax/fax +420-326-711-420
rampas@gedas.cz
<http://www.gedas.com/>