Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
IndxReal.c File Reference

Index heapsort a REAL array. More...

#include <math.h>
#include "MathType.h"

Go to the source code of this file.

Functions

void blIndexReal (REAL *arrin, int *indx, int n)
 

Detailed Description

Index heapsort a REAL array.

Version
V1.4
Date
07.07.14
Author
Dr. Andrew C. R. Martin
Institute of Structural & Molecular Biology, University College London, Gower Street, London. WC1E 6BT.
andre.nosp@m.w@bi.nosp@m.oinf..nosp@m.org..nosp@m.uk andre.nosp@m.w.ma.nosp@m.rtin@.nosp@m.ucl..nosp@m.ac.uk

This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.

The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.

The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.

Description:

This routine uses a heapsort to index a floating point array such that arrin[indx[j]] is in ascending order with j. It is modified from the FORTRAN version in 'Numerical Recipes' Page 233. This version correctly sorts from array element 0 as opposed to 1 in the FORTRAN version.

Usage:

  IndexReal(arrin,indx,n);
  Input:  int   n       Number of elements in array
          REAL  *arrin  Array to be indexed
  Output: int   *indx   Index array

Revision History:

Definition in file IndxReal.c.

Function Documentation

void blIndexReal ( REAL arrin,
int *  indx,
int  n 
)
Parameters
[in]*arrinArray to be indexed
[in]nNumber of elements in array
[out]*indxIndex array

Index an array by Heapsort.

  • 03.06.90 Original
  • 01.06.92 ANSIed and autodoc'd
  • 19.07.93 Corrected bug (said j=l+1 rather than j=l+l). Oops!
  • 08.07.96 Changed from double to REAL and tidied. Changed param order
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 110 of file IndxReal.c.