This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]