BINS
Order, Sort and Search Data using Bins
BINS
is a FORTRAN77 library which
can sort data into order, or lump
it into bins, or select an item of particular rank, or find
the unique elements in a list.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
BINS is available in
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version.
Related Data and Programs:
SUBPAK,
a FORTRAN77 library which
contains many routines for sorting and searching data.
Reference:
-
Jon Bentley, Bruce Weide, Andrew Yao,
Optimal Expected Time Algorithms for Closest Point Problems,
ACM Transactions on Mathematical Software,
Volume 6, Number 4, December 1980, pages 563-580.
-
Thomas Cormen, Charles Leiserson, Ronald Rivest,
Introduction to Algorithms,
MIT Press, 2001,
ISBN: 0262032937,
LC: QA76.C662.
-
Barry Joe,
GEOMPACK - a software package for the generation of meshes
using geometric algorithms,
Advances in Engineering Software,
Volume 13, pages 325-331, 1991.
-
Albert Nijenhuis, Herbert Wilf,
Combinatorial Algorithms for Computers and Calculators,
Second Edition,
Academic Press, 1978,
ISBN: 0-12-519260-6,
LC: QA164.N54.
Source Code:
-
bins.f, the source code.
-
bins.sh,
commands to compile the source code.
Examples and Tests:
List of Routines:
-
BIN_SEARCH_ONE_2D searches one cell in a 2D array of bins.
-
BIN_TO_R8_EVEN returns the limits for a given "bin" in [A,B].
-
BIN_TO_R8_EVEN2 returns the limits for a given "bin" in [A,B].
-
BIN_TO_R82_EVEN returns the limits for a given R82 "bin" in [A,B].
-
BIN_TO_R82_EVEN2 returns the limits for a given D82 "bin" in [A,B].
-
BIN_TO_R82_EVEN3 returns the limits for a given R82 "bin" in [A,B].
-
BIN_TO_R83_EVEN2 returns the limits for a given R83 "bin" in [A,B].
-
BIN_TO_R83_EVEN3 returns the limits for a given R83 "bin" in [A,B].
-
BIN_TO_R8VEC_EVEN3 returns the limits for a given R8VEC "bin" in [A,B].
-
DIAEDG chooses a diagonal edge.
-
GET_SEED returns a seed for the random number generator.
-
I4_MODP returns the nonnegative remainder of integer division.
-
I4_SWAP switches two I4's.
-
I4_WRAP forces an I4 to lie between given limits by wrapping.
-
I4MAT_PRINT prints an I4MAT.
-
I4MAT_PRINT_SOME prints some of an I4MAT.
-
I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
-
I4MAT_TRANSPOSE_PRINT_SOME prints some of the transpose of an I4MAT.
-
I4VEC_HEAP_D reorders an I4VEC into an descending heap.
-
I4VEC_INDICATOR sets an I4VEC to the indicator vector.
-
I4VEC_PRINT prints an I4VEC.
-
I4VEC_SORT_HEAP_A ascending sorts an I4VEC using heap sort.
-
I4VEC_SORTED_UNIQUE finds the unique elements in a sorted I4VEC.
-
I4VEC2_COMPARE compares pairs of integers stored in two vectors.
-
I4VEC2_SORT_A ascending sorts a vector of pairs of integers.
-
I4VEC2_SORTED_UNIQUE keeps the unique elements in a array of pairs of integers.
-
INDEX_BOX2_NEXT_2D produces indices on the surface of a box in 2D.
-
INDEX_BOX2_NEXT_3D produces indices on the surface of a box in 3D.
-
LRLINE determines where a point lies in relation to a directed line.
-
PERM_INV inverts a permutation "in place".
-
POINTS_NEAREST_POINT_BINS3_2D finds the nearest point to a given point in 2D.
-
POINTS_NEAREST_POINT_BINS3_3D finds the nearest point to a given point in 3D.
-
R8_EPSILON returns the R8 roundoff unit.
-
R8_HUGE returns a "huge" R8.
-
R8_TO_BIN_EVEN determines the appropriate "bin" for C in [A,B].
-
R8_TO_BIN_EVEN2 determines the appropriate "bin" for C in [A,B].
-
R8_TO_BIN_UNEVEN places X in one of several unevenly spaced bins.
-
R8_UNIFORM returns a scaled pseudorandom R8.
-
R8_UNIFORM_01 returns a unit pseudorandom R8.
-
R82_TO_BIN_EVEN determines the appropriate "bin" for an R82 value.
-
R82_TO_BIN_EVEN2 determines the appropriate "bin" for an R82 value.
-
R82_TO_BIN_EVEN3 determines the appropriate "bin" for an R82 value.
-
R82VEC_BIN_EVEN bins an R82VEC into evenly spaced bins.
-
R82VEC_BIN_EVEN2 bins an R82VEC into evenly spaced bins.
-
R82VEC_BIN_EVEN3 bins an R82VEC into evenly spaced bins.
-
R82VEC_BINNED_REORDER reorders a binned R82 data vector.
-
R82VEC_BINNED_REORDER2 reorders a binned R82VEC.
-
R82VEC_BINNED_SORT_A sorts each bin of a binned R82VEC.
-
R82VEC_BINNED_SORT_A2 sorts each bin of a binned R82VEC.
-
R82VEC_PERMUTE permutes an R82VEC in place.
-
R82VEC_PRINT prints an R82VEC.
-
R82VEC_SORT_QUICK_A ascending sorts an R82VEC using quick sort.
-
R82VEC_UNIFORM returns a random R82VEC in a given range.
-
R83_TO_BIN_EVEN2 determines the appropriate "bin" for an R83 value.
-
R83_TO_BIN_EVEN3 determines the appropriate "bin" for an R83 value.
-
R83VEC_BIN_EVEN2 bins an R83VEC into evenly spaced bins.
-
R83VEC_BIN_EVEN3 bins an R83VEC into evenly spaced bins.
-
R83VEC_BINNED_REORDER reorders a binned R83 data vector.
-
R83VEC_BINNED_REORDER2 reorders a binned R83VEC.
-
R83VEC_BINNED_SORT_A sorts each bin of a binned R83VEC.
-
R83VEC_BINNED_SORT_A2 sorts each bin of a binned R83VEC.
-
R83VEC_PART_QUICK_A reorders an R83VEC as part of a quick sort.
-
R83VEC_SORT_QUICK_A ascending sorts an R83VEC using quick sort.
-
R83VEC_UNIFORM returns a random R83VEC in a given range.
-
R8MAT_PRINT prints an R8MAT.
-
R8MAT_PRINT_SOME prints some of an R8MAT.
-
R8VEC_BIN bins an R8VEC, returning the population of each bin.
-
R8VEC_BIN_EVEN bins an R8VEC into evenly spaced bins.
-
R8VEC_BINNED_REORDER reorders a binned R8VEC.
-
R8VEC_BINNED_SORT_A ascending sorts a binned reordered R8VEC.
-
R8VEC_BRACKET searches a sorted array for successive brackets of a value.
-
R8VEC_EQ is true if every pair of entries in two vectors is equal.
-
R8VEC_GT == ( A1 > A2 ) for double precision vectors.
-
R8VEC_LT == ( A1 < A2 ) for double precision vectors.
-
R8VEC_PART_QUICK_A reorders an R8VEC as part of a quick sort.
-
R8VEC_PRINT prints an R8VEC.
-
R8VEC_SORT_QUICK_A ascending sorts an R8VEC using quick sort.
-
R8VEC_SWAP swaps two R8VEC's.
-
R8VEC_TO_BIN_EVEN3 determines the appropriate "bin" for a R8VEC value.
-
R8VEC_UNIFORM returns a scaled pseudorandom R8VEC.
-
S_LEN_TRIM returns the length of a string to the last nonblank.
-
SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.
-
TIMESTAMP prints out the current YMDHMS date as a timestamp.
-
TRIANGLE_AREA_2D computes the area of a triangle in 2D.
-
TRIANGLE_SAMPLE_2D returns a random point in a triangle.
-
TUPLE_NEXT2 computes the next element of an integer tuple space.
You can go up one level to
the FORTRAN77 source codes.
Last revised on 29 July 2008.