generic MEAN and MEDIAN, new function DISPLACE-ARRAY
commit485544d4feb13d3f463f54a5605b3a480bc49046
authortpapp <tkpapp@gmail.com>
Wed, 4 Jan 2012 11:28:39 +0000 (4 12:28 +0100)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 20 Jan 2012 15:34:19 +0000 (20 17:34 +0200)
tree1d62cf2c7dabf7f75ee4f2c4b3af38c39bfac085
parent36800ad120545e48e80ce5f2defacf6366ea8404
generic MEAN and MEDIAN, new function DISPLACE-ARRAY

 Objects other than sequences have means and medians (eg probability
 distributions, arrays, sequences/arrays wrapped in another object, etc), so
 it makes sense to make these functions generic.

 DISPLACE-ARRAY is a small utility function that is used in the implementation
 of MEDIAN for arrays, but is also of general utility because it makes the
 creation of displaced arrays simpler, dispensing with the need to specify the
 element type, and offering sensible defaults when one wants vectors.

 Also added tests for all the new functions/methods.
arrays.lisp
numbers.lisp
package.lisp
tests.lisp