[go: up one dir, main page]

Menu

[r303]: / libpetey / README  Maximize  Restore  History

Download this file

105 lines (70 with data), 5.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
Installation

To install, download the tarball from Sourceforge and unpack to the desired location.  Edit the makefile and type, "make".  You must have the GSL (GNU Scientific Library installed.  For a complete list of dependencies, see below.  To copy the library and include files to the appropriate directories, type, "make install".  Or, simply add the installation directory to your path.  The following macros must be changed to suit your system:

CPP		= name of your C++ compiler
GSL_INCLUDE	= location of GSL include files
INCLUDE_PATH	= desired location of include files
LIB_PATH	= desired location of compiled library
CFLAGS		= compiler options

The level of optimisation can be changed in the usual way by editing the CFLAGS macro or by setting the OPT_VER macro to the desired flag.  This is to create multiple versions with different levels of optimisation--the optimisation flag will be appended to all compiled object files and libraries.

There are two satellite libraries included with the distribution: a library for
sparse matrices and a library for specialized "datasets."  To make and install
only the main library (as needed by libagf), type "make petey" and 
"make install_petey." Note that the sparse library, in addition to the GSL,
also requires the Arpack library.  I've found a small bug in
the library, at least when compiled with gfortran/g77: under the "UTIL" 
directory, there is a file/function called, second.f.  Line 24 should be 
changed from, "EXTERNAL ETIME", to "INTRINSIC ETIME".  This is partially 
documented in the "README" instructions, but not this particular fix.

Also particular to the sparse library: you must supply a fortran compiler
and the runtime library that goes with it.  In older version of GNU, these
would be "g77" and "g2c" respectively.  In newer versions, "gfortran" and
"gfortran".  The make macros are:
F77 = gfortran
FORTRAN_RUNTIME = gfortran

The make macros for the arpack library are:
LIBARPACK = libarpack
ARPATH =/usr/local/lib

To change the leading and trailing underscores in Fortran routines used in
C++ programs:
FLEADING_UNDERSCORES = 
FTRAILING_UNDERSCORES = _

The user should change these to suit his or her system.

List of Dependencies

I suppose these will show up in the error listings when you type, "make," (if anything's missing, which it always is) but sometimes it's nice to know things ahead of time.  Maybe I should bite the bullet and learn how to create configure scripts.  (Does not include recursive dependencies, i.e. readline seems to require ncurses.)

- C++ (duh)
- GNU make
- Fortran (gfortran)
- lex/yacc
- GNU Scientific Library (GSL)
- readline/history
- ARPACK


Summary

Here is a brief summary of the contents of the library, by include file:

peteys_tmpl_lib.h:  A set of template libraries for numerical computation.

heapsort_inplace:	Performs a heapsort on arbitary classes (as long as they have the comparison operators defined).  This is done in place with no extra storage required.
heapsort:		Performs a heapsort.  Returns a set of indices for rearranging a vector while leaving the original vector untouched.  Slightly slower than above.
treesort:		Treesort routine.  Sorts the data and returns a set of indices.
reverse:		Reverses the order of an array.
map_vector:		For use with heapsort routine.  Rearranges a vector from a set of indices.
bin_search:		Binary search on ordered data.
interpolate:		Interpolation on ordered data.  Returns a double precision float in which the whole number portion indexes into the array while the fractional value is the interpolation coefficient.
rk_dumb:		Fourth-order Runge-Kutta integrator with fixed (non-adaptive) stepsize.

kextreme.h:  Routines for finding a set of k minimum or maximum values in an unsorted array.  Performs this in n log k time using binary trees.

kleast:		Returns the k minimum values in an array.  Two versions: one returns a set of indices.
kgreatest:	Returns the k maximum values in an array.  		"

time_class.h:	A class for working with dates and times.  Very useful.

supernewton.h:	A very powerful root-finding algorithm.  Works by bracketing the root and fitting a third-order polynomial, combining fast convergence with numerical stability.  Function to be zeroed must return its derivatives.

tree_lg:	Binary tree class used to find k- minimum and maximum values.
tree_lgi:	Binary tree class used to find k- minimum and maximum values.  Sorts indices simultaneous to actual values.

linked.h:	Templated linked-list class.

tree_tmp.h:	Another binary tree class.  Not well tested.

string_petey.h:	A string class.  Not well tested.

bit_array.h:	For compact storage of bit data.

quicksort.h:	Quicksort routine plus k-least routines based on a quicksort.

parse_command_opts: Subroutine for parsing the optional command arguments
		in far fewer commands than getopt.

petey_pointer.h: "Smart" pointer template class.

symbol_table.h: Templated symbol table class.


Questions or comments about this software?  Email me:

Peter Mills
peteymills@hotmail.com