BINS
Order, Sort and Search Data using Bins
BINS
is a C++ library which
sorts data into order, or lumps
it into bins, or selects an item of particular rank, or finds
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 C++ 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.
-
Barry Joe,
GEOMPACK - a software package for the generation of meshes
using geometric algorithms,
Advances in Engineering Software,
Volume 13, 1991, pages 325-331.
-
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:
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_EVEN2 returns the limits for a given R82 "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].
-
GET_SEED returns a random seed for the random number generator.
-
I4_MAX returns the maximum of two I4's.
-
I4_MAX returns the smaller of two I4's.
-
I4_MODP returns the nonnegative remainder of I4 division.
-
I4_SIGN returns the sign of an I4.
-
I4_SWAP switches two I4's.
-
I4_UNIFORM returns a scaled pseudorandom I4.
-
I4_WRAP forces an I4 to lie between given limits by wrapping.
-
I4MAT_PRINT prints an I4MAT, with an optional title.
-
I4MAT_PRINT_SOME prints some of an I4MAT.
-
I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
-
I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.
-
I4VEC_HEAP_D reorders an I4VEC into a 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 unique elements in a sorted I4VEC.
-
I4VEC2_COMPARE compares pairs of integers stored in two I4VECs.
-
I4VEC2_SORT_A ascending sorts a vector of pairs of integers.
-
I4VEC2_SORTED_UNIQUE finds unique elements in a sorted I4VEC2.
-
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.
-
PERM_CHECK checks that a vector represents a permutation.
-
PERM_INV inverts a permutation "in place".
-
POINTS_NEAREST_POINT_NAIVE_2D finds the nearest point to a given point in 2D.
-
POINTS_NEAREST_POINT_NAIVE_3D finds the nearest point to a given point in 3D.
-
POINTS_NEAREST_POINT_NAIVE_ND finds the nearest point to a given point in ND.
-
POINTS_NEAREST_POINTS_NAIVE_2D finds the nearest point to given points in 2D.
-
POINTS_NEAREST_POINTS_NAIVE_3D finds the nearest point to given points in 3D.
-
R4_NINT returns the nearest integer to an R4.
-
R8_HUGE returns a "huge" R8 value.
-
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_UNIFORM returns a scaled pseudorandom R8.
-
R8_UNIFORM_01 returns a unit pseudorandom R8.
-
R82_TO_BIN_EVEN2 determines the appropriate "bin" for an R82 value.
-
R82_TO_BIN_EVEN3 determines the appropriate "bin" for an R82 value.
-
R82_UNIFORM returns a random R82 value in a given range.
-
R82VEC_PART_QUICK_A reorders an R82 vector as part of a quick sort.
-
R82VEC_PERMUTE permutes an R82VEC in place.
-
R82VEC_PRINT prints an R82VEC.
-
R82VEC_SORT_HEAP_INDEX_A does an indexed heap ascending sort of 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.
-
R83_TO_BIN_EVEN3 determines the appropriate "bin" for an R83.
-
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, with an optional title.
-
R8MAT_PRINT_SOME prints some of an R8MAT.
-
R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.
-
R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.
-
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 real vectors.
-
R8VEC_LT == ( A1 < A2 ) for real vectors.
-
R8VEC_PRINT prints a R8VEC.
-
R8VEC_SWAP swaps the entries of two R8VEC's.
-
R8VEC_UNIFORM fills an R8VEC with scaled pseudorandom values.
-
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 the current YMDHMS date as a time stamp.
-
TUPLE_NEXT2 computes the next element of an integer tuple space.
You can go up one level to
the C++ source codes.
Last revised on 28 January 2011.