All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sorts.Real_Sorts

java.lang.Object
   |
   +----sorts.Real_Sorts

public class Real_Sorts
extends Object

This class permits one to perform sorts of real numbers.


Constructor Index

 o Real_Sorts()

Method Index

 o rsort(double[], double[], int[], int)

This method attempts to perform an n*log(n) sort rather than an n*n sort.

Constructors

 o Real_Sorts
 public Real_Sorts()

Methods

 o rsort
 public static void rsort(double x[],
                          double xsort[],
                          int origord[],
                          int n)

This method attempts to perform an n*log(n) sort rather than an n*n sort. It sorts doubles. It also keeps track of the original order of the x's.

Steve Verrill, 5/2/89. Translated to Java from FORTRAN on 6/7/96.

There are other, faster sorts that are available in Java. See, for example, http://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.html

Parameters:
x[ ] - This contains the values to be sorted.
xsort[ ] - On return, this contains the x[ ] values sorted from smallest to largest.
origord[ ] - On return, origord[i] contains the original location of the value in xsort[i].
n - n is the number of values to be sorted.

All Packages  Class Hierarchy  This Package  Previous  Next  Index