head	1.2;
access;
symbols;
locks; strict;
comment	@// @;


1.2
date	95.01.20.03.56.09;	author gmt;	state Exp;
branches;
next	1.1;

1.1
date	94.11.21.01.15.29;	author gmt;	state Exp;
branches;
next	;


desc
@Templated qsort for those comiler that connat use the C library qsort.
@


1.2
log
@*** empty log message ***
@
text
@// Emacs -*- C++ -*-

//
//	Copyright 1994, Center for Computer Vision and Visualization,
//	University of Florida.  All rights reserved.
//

// $Id: IA_qsort.c,v 1.1 1994/11/21 01:15:29 gmt Exp $

// $Log: IA_qsort.c,v $
// Revision 1.1  1994/11/21  01:15:29  gmt
// Initial revision
//

#include "IA_qsort.h"

template <class T>
void IA_qsort( T *a, int l, int r )
{
  int v, i, j, t;
  if( r > l )
    {
      v = a[r];
      i = l - 1;
      j = r;
      while( 1 )
	{
	  while( a[++i] < v )
	    ;
	  while( a[--j] > v )
	    ;
	  if( i >= j )
	    break;
	  t = a[i];
	  a[i] = a[j];
	  a[j] = t;
	}
      t = a[i];
      a[i] = a[r];
      a[r] = t;
      IA_qsort( a, l, i - 1 );
      IA_qsort( a, i+1, r );
    }
}
@


1.1
log
@Initial revision
@
text
@d8 1
a8 1
// $Id$
d10 4
a13 1
// $Log$
@
