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


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

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


desc
@Templated bsearch for those compilers that cannot use the C library bsearch.
@


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_bsearch.c,v 1.1 1994/11/21 01:14:58 gmt Exp $

// $Log: IA_bsearch.c,v $
// Revision 1.1  1994/11/21  01:14:58  gmt
// Initial revision
//

#include "IA_bsearch.h"

template <class T>
T *IA_bsearch( T *key, T *base, size_t n )
{
  size_t i = 0, j;
  int k;
  T *guess;

  while( i < n )
    {
      j = ( i + n  - 1 ) >> 1;
      guess = base + j;
      if( *key == *guess )
	return guess;
      if( *key < *guess )
	n = j;
      else
	i = j + 1;
    }
  return ( T * )0;
}
@


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