[Scipy-svn] r4828 - in branches/refactor_fft: . scipy scipy/cluster scipy/cluster/src scipy/cluster/tests scipy/fftpack/benchmarks scipy/fftpack/tests scipy/integrate scipy/integrate/tests scipy/interpolate scipy/interpolate/tests scipy/io scipy/io/arff scipy/io/arff/tests scipy/io/matlab scipy/io/matlab/tests scipy/io/matlab/tests/data scipy/io/tests scipy/lib/blas/tests scipy/lib/lapack/tests scipy/linalg scipy/linalg/benchmarks scipy/linalg/tests scipy/maxentropy scipy/maxentropy/examples scipy/maxentropy/tests scipy/misc scipy/misc/tests scipy/ndimage scipy/odr/tests scipy/optimize scipy/optimize/nnls scipy/optimize/tests scipy/signal scipy/sparse scipy/sparse/benchmarks scipy/sparse/linalg/dsolve/SuperLU/SRC scipy/sparse/linalg/dsolve/tests scipy/sparse/linalg/dsolve/umfpack scipy/sparse/linalg/dsolve/umfpack/tests scipy/sparse/linalg/eigen/arpack scipy/sparse/linalg/eigen/arpack/tests scipy/sparse/linalg/eigen/lobpcg scipy/sparse/linalg/eigen/lobpcg/tests scipy/sparse/linalg/isolve scipy/sparse/linalg/isolve/tests scipy/sparse/linalg/tests scipy/sparse/sparsetools scipy/sparse/tests scipy/special scipy/special/cephes scipy/special/tests scipy/stats scipy/stats/tests scipy/stsci/convolve/lib scipy/stsci/image/lib scipy/weave scipy/weave/examples scipy/weave/tests tools tools/win32 tools/win32/build_scripts tools/win32/build_scripts/nsis_scripts

scipy-svn@scip... scipy-svn@scip...
Thu Oct 23 07:33:46 CDT 2008


Author: cdavid
Date: 2008-10-23 07:30:20 -0500 (Thu, 23 Oct 2008)
New Revision: 4828

Added:
   branches/refactor_fft/scipy/cluster/tests/cdist-X1.txt
   branches/refactor_fft/scipy/cluster/tests/cdist-X2.txt
   branches/refactor_fft/scipy/io/matlab/byteordercodes.py
   branches/refactor_fft/scipy/io/matlab/tests/data/testhdf5_7.4_GLNX86.mat
   branches/refactor_fft/scipy/io/matlab/tests/gen_unittests.m
   branches/refactor_fft/scipy/io/matlab/tests/gen_unittests4.m
   branches/refactor_fft/scipy/io/matlab/tests/save_test.m
   branches/refactor_fft/scipy/io/matlab/tests/test_byteordercodes.py
   branches/refactor_fft/scipy/optimize/nnls.py
   branches/refactor_fft/scipy/optimize/nnls/
   branches/refactor_fft/scipy/optimize/nnls/nnls.f
   branches/refactor_fft/scipy/optimize/nnls/nnls.pyf
   branches/refactor_fft/scipy/optimize/tests/test_nnls.py
   branches/refactor_fft/scipy/stats/vonmises.py
   branches/refactor_fft/scipy/stats/vonmises_cython.c
   branches/refactor_fft/scipy/stats/vonmises_cython.pyx
   branches/refactor_fft/tools/
   branches/refactor_fft/tools/win32/
   branches/refactor_fft/tools/win32/build_scripts/
   branches/refactor_fft/tools/win32/build_scripts/nsis_scripts/
   branches/refactor_fft/tools/win32/build_scripts/nsis_scripts/scipy-superinstaller.nsi.in
   branches/refactor_fft/tools/win32/build_scripts/pavement.py
Removed:
   branches/refactor_fft/scipy/io/tests/gen_unittests.m
   branches/refactor_fft/scipy/io/tests/gen_unittests4.m
   branches/refactor_fft/scipy/io/tests/save_test.m
   branches/refactor_fft/scipy/optimize/nnls/nnls.f
   branches/refactor_fft/scipy/optimize/nnls/nnls.pyf
   branches/refactor_fft/scipy/weave/tests/test_scxx.py
   branches/refactor_fft/tools/win32/
   branches/refactor_fft/tools/win32/build_scripts/
   branches/refactor_fft/tools/win32/build_scripts/nsis_scripts/
   branches/refactor_fft/tools/win32/build_scripts/nsis_scripts/scipy-superinstaller.nsi.in
   branches/refactor_fft/tools/win32/build_scripts/pavement.py
Modified:
   branches/refactor_fft/
   branches/refactor_fft/THANKS.txt
   branches/refactor_fft/scipy/__init__.py
   branches/refactor_fft/scipy/cluster/distance.py
   branches/refactor_fft/scipy/cluster/hierarchy.py
   branches/refactor_fft/scipy/cluster/src/distance.c
   branches/refactor_fft/scipy/cluster/src/distance.h
   branches/refactor_fft/scipy/cluster/src/distance_wrap.c
   branches/refactor_fft/scipy/cluster/tests/test_distance.py
   branches/refactor_fft/scipy/cluster/tests/test_hierarchy.py
   branches/refactor_fft/scipy/cluster/tests/test_vq.py
   branches/refactor_fft/scipy/fftpack/benchmarks/bench_basic.py
   branches/refactor_fft/scipy/fftpack/benchmarks/bench_pseudo_diffs.py
   branches/refactor_fft/scipy/fftpack/tests/test_basic.py
   branches/refactor_fft/scipy/fftpack/tests/test_helper.py
   branches/refactor_fft/scipy/fftpack/tests/test_pseudo_diffs.py
   branches/refactor_fft/scipy/integrate/ode.py
   branches/refactor_fft/scipy/integrate/quadpack.py
   branches/refactor_fft/scipy/integrate/quadrature.py
   branches/refactor_fft/scipy/integrate/tests/test_integrate.py
   branches/refactor_fft/scipy/integrate/tests/test_quadpack.py
   branches/refactor_fft/scipy/interpolate/SConscript
   branches/refactor_fft/scipy/interpolate/interpolate.py
   branches/refactor_fft/scipy/interpolate/polyint.py
   branches/refactor_fft/scipy/interpolate/tests/test_fitpack.py
   branches/refactor_fft/scipy/io/__init__.py
   branches/refactor_fft/scipy/io/arff/arffread.py
   branches/refactor_fft/scipy/io/arff/tests/test_data.py
   branches/refactor_fft/scipy/io/arff/tests/test_header.py
   branches/refactor_fft/scipy/io/fopen.py
   branches/refactor_fft/scipy/io/matlab/mio.py
   branches/refactor_fft/scipy/io/matlab/mio4.py
   branches/refactor_fft/scipy/io/matlab/mio5.py
   branches/refactor_fft/scipy/io/matlab/miobase.py
   branches/refactor_fft/scipy/io/matlab/tests/test_mio.py
   branches/refactor_fft/scipy/io/mmio.py
   branches/refactor_fft/scipy/io/netcdf.py
   branches/refactor_fft/scipy/io/tests/test_mmio.py
   branches/refactor_fft/scipy/lib/blas/tests/test_blas.py
   branches/refactor_fft/scipy/lib/blas/tests/test_fblas.py
   branches/refactor_fft/scipy/lib/lapack/tests/test_lapack.py
   branches/refactor_fft/scipy/linalg/benchmarks/bench_basic.py
   branches/refactor_fft/scipy/linalg/benchmarks/bench_decom.py
   branches/refactor_fft/scipy/linalg/matfuncs.py
   branches/refactor_fft/scipy/linalg/tests/test_atlas_version.py
   branches/refactor_fft/scipy/linalg/tests/test_basic.py
   branches/refactor_fft/scipy/linalg/tests/test_blas.py
   branches/refactor_fft/scipy/linalg/tests/test_decomp.py
   branches/refactor_fft/scipy/linalg/tests/test_fblas.py
   branches/refactor_fft/scipy/linalg/tests/test_lapack.py
   branches/refactor_fft/scipy/linalg/tests/test_matfuncs.py
   branches/refactor_fft/scipy/maxentropy/examples/bergerexample.py
   branches/refactor_fft/scipy/maxentropy/examples/conditionalexample2.py
   branches/refactor_fft/scipy/maxentropy/maxentropy.py
   branches/refactor_fft/scipy/maxentropy/maxentutils.py
   branches/refactor_fft/scipy/maxentropy/tests/test_maxentropy.py
   branches/refactor_fft/scipy/misc/common.py
   branches/refactor_fft/scipy/misc/pilutil.py
   branches/refactor_fft/scipy/misc/tests/test_pilutil.py
   branches/refactor_fft/scipy/ndimage/SConscript
   branches/refactor_fft/scipy/ndimage/fourier.py
   branches/refactor_fft/scipy/ndimage/interpolation.py
   branches/refactor_fft/scipy/ndimage/morphology.py
   branches/refactor_fft/scipy/odr/tests/test_odr.py
   branches/refactor_fft/scipy/optimize/SConscript
   branches/refactor_fft/scipy/optimize/linesearch.py
   branches/refactor_fft/scipy/optimize/minpack.py
   branches/refactor_fft/scipy/optimize/optimize.py
   branches/refactor_fft/scipy/optimize/setup.py
   branches/refactor_fft/scipy/optimize/slsqp.py
   branches/refactor_fft/scipy/optimize/tests/test_optimize.py
   branches/refactor_fft/scipy/optimize/tests/test_slsqp.py
   branches/refactor_fft/scipy/optimize/tests/test_zeros.py
   branches/refactor_fft/scipy/optimize/zeros.py
   branches/refactor_fft/scipy/signal/bsplines.py
   branches/refactor_fft/scipy/signal/signaltools.py
   branches/refactor_fft/scipy/signal/wavelets.py
   branches/refactor_fft/scipy/sparse/benchmarks/bench_sparse.py
   branches/refactor_fft/scipy/sparse/bsr.py
   branches/refactor_fft/scipy/sparse/compressed.py
   branches/refactor_fft/scipy/sparse/construct.py
   branches/refactor_fft/scipy/sparse/coo.py
   branches/refactor_fft/scipy/sparse/csc.py
   branches/refactor_fft/scipy/sparse/csr.py
   branches/refactor_fft/scipy/sparse/dia.py
   branches/refactor_fft/scipy/sparse/dok.py
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsequ.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/cgsrfs.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/clacon.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/clangs.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotL.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/cpivotgrowth.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/cutil.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/scomplex.h
   branches/refactor_fft/scipy/sparse/linalg/dsolve/SuperLU/SRC/scsum1.c
   branches/refactor_fft/scipy/sparse/linalg/dsolve/tests/test_linsolve.py
   branches/refactor_fft/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py
   branches/refactor_fft/scipy/sparse/linalg/dsolve/umfpack/umfpack.py
   branches/refactor_fft/scipy/sparse/linalg/eigen/arpack/speigs.py
   branches/refactor_fft/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py
   branches/refactor_fft/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
   branches/refactor_fft/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py
   branches/refactor_fft/scipy/sparse/linalg/isolve/iterative.py
   branches/refactor_fft/scipy/sparse/linalg/isolve/minres.py
   branches/refactor_fft/scipy/sparse/linalg/isolve/tests/test_iterative.py
   branches/refactor_fft/scipy/sparse/linalg/tests/test_interface.py
   branches/refactor_fft/scipy/sparse/sparsetools/coo.h
   branches/refactor_fft/scipy/sparse/sparsetools/coo.i
   branches/refactor_fft/scipy/sparse/sparsetools/coo.py
   branches/refactor_fft/scipy/sparse/sparsetools/coo_wrap.cxx
   branches/refactor_fft/scipy/sparse/sparsetools/csc.i
   branches/refactor_fft/scipy/sparse/sparsetools/csc.py
   branches/refactor_fft/scipy/sparse/sparsetools/csc_wrap.cxx
   branches/refactor_fft/scipy/sparse/sparsetools/csr.h
   branches/refactor_fft/scipy/sparse/sparsetools/csr.i
   branches/refactor_fft/scipy/sparse/sparsetools/csr.py
   branches/refactor_fft/scipy/sparse/sparsetools/csr_wrap.cxx
   branches/refactor_fft/scipy/sparse/sparsetools/dia.py
   branches/refactor_fft/scipy/sparse/sparsetools/dia_wrap.cxx
   branches/refactor_fft/scipy/sparse/sparsetools/sparsetools.i
   branches/refactor_fft/scipy/sparse/spfuncs.py
   branches/refactor_fft/scipy/sparse/sputils.py
   branches/refactor_fft/scipy/sparse/tests/test_base.py
   branches/refactor_fft/scipy/sparse/tests/test_extract.py
   branches/refactor_fft/scipy/sparse/tests/test_sputils.py
   branches/refactor_fft/scipy/special/cephes/jv.c
   branches/refactor_fft/scipy/special/cephes_doc.h
   branches/refactor_fft/scipy/special/info.py
   branches/refactor_fft/scipy/special/tests/test_basic.py
   branches/refactor_fft/scipy/stats/_support.py
   branches/refactor_fft/scipy/stats/continuous.lyx
   branches/refactor_fft/scipy/stats/distributions.py
   branches/refactor_fft/scipy/stats/mmorestats.py
   branches/refactor_fft/scipy/stats/morestats.py
   branches/refactor_fft/scipy/stats/mstats.py
   branches/refactor_fft/scipy/stats/setup.py
   branches/refactor_fft/scipy/stats/stats.py
   branches/refactor_fft/scipy/stats/tests/test_distributions.py
   branches/refactor_fft/scipy/stats/tests/test_mmorestats.py
   branches/refactor_fft/scipy/stats/tests/test_mstats.py
   branches/refactor_fft/scipy/stats/tests/test_stats.py
   branches/refactor_fft/scipy/stsci/convolve/lib/Convolve.py
   branches/refactor_fft/scipy/stsci/convolve/lib/iraf_frame.py
   branches/refactor_fft/scipy/stsci/convolve/lib/lineshape.py
   branches/refactor_fft/scipy/stsci/image/lib/_image.py
   branches/refactor_fft/scipy/stsci/image/lib/combine.py
   branches/refactor_fft/scipy/weave/accelerate_tools.py
   branches/refactor_fft/scipy/weave/examples/vq.py
   branches/refactor_fft/scipy/weave/tests/test_blitz_tools.py
   branches/refactor_fft/scipy/weave/tests/test_c_spec.py
   branches/refactor_fft/scipy/weave/tests/test_ext_tools.py
   branches/refactor_fft/scipy/weave/tests/test_inline_tools.py
   branches/refactor_fft/scipy/weave/tests/test_numpy_scalar_spec.py
   branches/refactor_fft/scipy/weave/tests/test_scxx_dict.py
   branches/refactor_fft/scipy/weave/tests/test_scxx_object.py
   branches/refactor_fft/scipy/weave/tests/test_scxx_sequence.py
   branches/refactor_fft/scipy/weave/tests/test_size_check.py
   branches/refactor_fft/scipy/weave/tests/weave_test_utils.py
Log:
Merged revisions 4694-4827 via svnmerge from 
http://svn.scipy.org/svn/scipy/trunk

........
  r4694 | damian.eads | 2008-09-08 04:28:06 +0900 (Mon, 08 Sep 2008) | 1 line
  
  Added cdist function for computing distances between two collections of vectors. Added tests for the cdist function.
........
  r4696 | damian.eads | 2008-09-08 14:01:06 +0900 (Mon, 08 Sep 2008) | 1 line
  
  RSTified more hierarchy docs.
........
  r4697 | pierregm | 2008-09-08 14:01:53 +0900 (Mon, 08 Sep 2008) | 1 line
  
  mstats.mode: make sure that mode returns a tuple.
........
  r4700 | pierregm | 2008-09-08 17:05:22 +0900 (Mon, 08 Sep 2008) | 1 line
  
  * force compatibility between mstats.mode and stats.mode
........
  r4703 | damian.eads | 2008-09-08 23:47:40 +0900 (Mon, 08 Sep 2008) | 1 line
  
  RSTified more hierarchy docs.
........
  r4704 | ptvirtan | 2008-09-09 03:57:39 +0900 (Tue, 09 Sep 2008) | 1 line
  
  Fix Bessel K_nu function name in docstrings: 'modified Bessel function of the second kind' is the more common name, rather than the 'third kind'
........
  r4705 | alan.mcintyre | 2008-09-09 22:46:55 +0900 (Tue, 09 Sep 2008) | 4 lines
  
  Standardize NumPy import as "import numpy as np".
  Removed unused numpy import.
  Clean up alignment of multiline statements.
........
  r4706 | alan.mcintyre | 2008-09-09 22:55:11 +0900 (Tue, 09 Sep 2008) | 2 lines
  
  Standardize NumPy import as "import numpy as np".
........
  r4707 | alan.mcintyre | 2008-09-09 23:16:57 +0900 (Tue, 09 Sep 2008) | 3 lines
  
  Standardize NumPy import as "import numpy as np".
  Removed unused numpy import.
........
  r4708 | cdavid | 2008-09-10 02:11:12 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Start the prepare bootstrap for scipy.
........
  r4709 | cdavid | 2008-09-10 02:12:17 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Add func to build scipy tarball.
........
  r4710 | cdavid | 2008-09-10 02:12:59 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Fix mising dot between release version and dev.
........
  r4711 | cdavid | 2008-09-10 02:13:49 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Full version string correctly generated.
........
  r4712 | cdavid | 2008-09-10 02:14:37 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Bootsrap script can now prepare scipy sources.
........
  r4713 | cdavid | 2008-09-10 02:15:25 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Remove global var reference.
........
  r4714 | cdavid | 2008-09-10 02:16:19 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Add build script for scipy.
........
  r4715 | cdavid | 2008-09-10 02:17:02 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Copy build script in bootstrapped sources.
........
  r4716 | cdavid | 2008-09-10 02:17:57 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Remove numpy references in scipy build script.
........
  r4717 | cdavid | 2008-09-10 02:18:55 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Add nsis script to bootstap.
........
  r4718 | cdavid | 2008-09-10 02:19:48 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Add nsis script to build super installer.
........
  r4719 | cdavid | 2008-09-10 02:20:26 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Fix numpy script leftover.
........
  r4720 | cdavid | 2008-09-10 02:21:11 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Forgot to pass ROOT dir to scipy_version func.
........
  r4721 | cdavid | 2008-09-10 02:22:00 +0900 (Wed, 10 Sep 2008) | 2 lines
  
  Rename nsis script.
........
  r4722 | cdavid | 2008-09-10 03:11:27 +0900 (Wed, 10 Sep 2008) | 1 line
  
  Fix missing imports.
........
  r4723 | alan.mcintyre | 2008-09-19 04:12:41 +0900 (Fri, 19 Sep 2008) | 3 lines
  
  Removed unused imports.
  PEP8 conformance (one import per line).
........
  r4724 | alan.mcintyre | 2008-09-19 04:15:47 +0900 (Fri, 19 Sep 2008) | 3 lines
  
  Removed unused imports.
  Standardized NumPy import as "import numpy as np".
........
  r4725 | alan.mcintyre | 2008-09-19 04:23:58 +0900 (Fri, 19 Sep 2008) | 4 lines
  
  Removed unused imports.
  Standardized NumPy import as "import numpy as np".
  PEP8 conformance (one import per line).
........
  r4726 | alan.mcintyre | 2008-09-19 04:27:00 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Removed unused imports.
........
  r4727 | alan.mcintyre | 2008-09-19 04:28:38 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Removed unused imports.
........
  r4728 | alan.mcintyre | 2008-09-19 04:30:13 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Remove unused imports.
........
  r4729 | alan.mcintyre | 2008-09-19 04:31:49 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Remove unused/redundant imports.
........
  r4730 | alan.mcintyre | 2008-09-19 04:34:57 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Removed unused/redundant imports.
........
  r4731 | alan.mcintyre | 2008-09-19 04:37:37 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Removed unused imports.
........
  r4732 | alan.mcintyre | 2008-09-19 04:45:20 +0900 (Fri, 19 Sep 2008) | 3 lines
  
  Removed unused imports.
  Removed test_scxx.py (the nose framework doesn't need to import the test_scxx* modules to find the tests).
........
  r4733 | alan.mcintyre | 2008-09-19 04:50:45 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Removed unused imports.
........
  r4734 | alan.mcintyre | 2008-09-19 04:55:02 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Removed unused imports.
........
  r4735 | alan.mcintyre | 2008-09-19 04:57:42 +0900 (Fri, 19 Sep 2008) | 2 lines
  
  Removed unused imports.
........
  r4736 | alan.mcintyre | 2008-09-19 05:00:22 +0900 (Fri, 19 Sep 2008) | 3 lines
  
  Removed unused imports.
  Moved imports to the top of modules.
........
  r4737 | alan.mcintyre | 2008-09-19 06:20:05 +0900 (Fri, 19 Sep 2008) | 3 lines
  
  Removed unused imports.
  Standardize NumPy import as "import numpy as np".
........
  r4738 | alan.mcintyre | 2008-09-21 08:00:11 +0900 (Sun, 21 Sep 2008) | 2 lines
  
  Remove unused imports.
........
  r4739 | alan.mcintyre | 2008-09-21 08:01:08 +0900 (Sun, 21 Sep 2008) | 2 lines
  
  Silence debugging print statements when verbosity < 3.
........
  r4740 | damian.eads | 2008-09-21 12:15:27 +0900 (Sun, 21 Sep 2008) | 1 line
  
  Corrected spelling of hierarchical.
........
  r4741 | oliphant | 2008-09-25 02:17:51 +0900 (Thu, 25 Sep 2008) | 1 line
  
  Remove typecode from _support
........
  r4742 | cdavid | 2008-09-26 13:00:25 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  Deprecate scipy.stats.var for numpy.var.
........
  r4743 | cdavid | 2008-09-26 13:01:16 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  scipy.stats.warn raise a DeprecationWarning.
........
  r4744 | cdavid | 2008-09-26 13:02:08 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  Deprecate scipy.stats.std.
........
  r4745 | cdavid | 2008-09-26 13:02:51 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  Fix deprecation warning for stats.var.
........
  r4746 | cdavid | 2008-09-26 13:03:37 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  Deprecate stats.mean.
........
  r4747 | cdavid | 2008-09-26 13:04:19 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  Deprecate stats.median.
........
  r4748 | cdavid | 2008-09-26 13:05:03 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  Deprecate stats.cov.
........
  r4749 | cdavid | 2008-09-26 13:05:42 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  Deprecate stats.corrcoef.
........
  r4750 | cdavid | 2008-09-26 13:06:26 +0900 (Fri, 26 Sep 2008) | 2 lines
  
  Fix cov/corrcoef deprecation.
........
  r4751 | cdavid | 2008-09-26 13:25:25 +0900 (Fri, 26 Sep 2008) | 1 line
  
  Do not modify error handling when importing scipy.
........
  r4752 | oliphant | 2008-09-26 21:53:59 +0900 (Fri, 26 Sep 2008) | 1 line
  
  Fix distributions to return numpy scalars instead of 0-d arrays.
........
  r4753 | oliphant | 2008-09-28 06:46:03 +0900 (Sun, 28 Sep 2008) | 1 line
  
  Fix error in est_loc_scale.
........
  r4754 | uwe.schmitt | 2008-09-30 05:13:24 +0900 (Tue, 30 Sep 2008) | 1 line
  
  added nnls, incl. test script
........
  r4755 | uwe.schmitt | 2008-09-30 15:45:52 +0900 (Tue, 30 Sep 2008) | 1 line
  
  removed obsolete default parameters from nnls()
........
  r4756 | uwe.schmitt | 2008-09-30 15:48:15 +0900 (Tue, 30 Sep 2008) | 1 line
  
  removed NNLS type from setup.py and Sconscript
........
  r4757 | uwe.schmitt | 2008-09-30 16:00:07 +0900 (Tue, 30 Sep 2008) | 1 line
  
  renamed NNLS.F to nnls.f
........
  r4758 | damian.eads | 2008-10-01 04:14:59 +0900 (Wed, 01 Oct 2008) | 1 line
  
  Fixed minor bug in cophenet.
........
  r4759 | peridot | 2008-10-01 08:55:21 +0900 (Wed, 01 Oct 2008) | 2 lines
  
  New module for spatial data structure. Currently contains one pure-python implementation of a kd-tree.
........
  r4760 | damian.eads | 2008-10-01 09:10:16 +0900 (Wed, 01 Oct 2008) | 1 line
  
  Added order keyword in asarray statements to ensure contiguity of data prior to passing to C functions.
........
  r4761 | damian.eads | 2008-10-01 09:14:20 +0900 (Wed, 01 Oct 2008) | 1 line
  
  Added order keyword in asarray statements to ensure contiguity of data prior to passing to C functions.
........
  r4763 | peridot | 2008-10-01 18:52:45 +0900 (Wed, 01 Oct 2008) | 2 lines
  
  Removed spatial; it's in a branch now so that it won't interfere with 0.7.
........
  r4764 | rkern | 2008-10-02 04:38:40 +0900 (Thu, 02 Oct 2008) | 1 line
  
  BUG: Remove mistaken commit.
........
  r4765 | oliphant | 2008-10-03 23:31:41 +0900 (Fri, 03 Oct 2008) | 1 line
  
  Fix jv(3,4) case by special casing.  The problem is in the recur function which seems to have a special-case problem with n=3 and x=4 because pk=qk in that case.
........
  r4766 | oliphant | 2008-10-04 03:57:20 +0900 (Sat, 04 Oct 2008) | 1 line
  
  Improve docstring of lognorm a bit.
........
  r4767 | wnbell | 2008-10-05 07:22:39 +0900 (Sun, 05 Oct 2008) | 4 lines
  
  rename c_abs() and c_abs1() to slu_c_abs() and slu_c_abs() to
  avoid conflict with Python headers
  hopefully resolves ticket #735
........
  r4768 | wnbell | 2008-10-05 07:33:54 +0900 (Sun, 05 Oct 2008) | 2 lines
  
  fix spelling in c_abs renaming
........
  r4770 | matthew.brett@gmail.com | 2008-10-05 09:58:08 +0900 (Sun, 05 Oct 2008) | 1 line
  
  Centralize recognition of matfile type, apply patch for ticket #743 by Ray Jones, with thanks
........
  r4771 | matthew.brett@gmail.com | 2008-10-05 10:54:59 +0900 (Sun, 05 Oct 2008) | 1 line
  
  Restore matlab m files for creating test mat files
........
  r4772 | wnbell | 2008-10-05 11:23:37 +0900 (Sun, 05 Oct 2008) | 2 lines
  
  minor additions to sparsetools
........
  r4773 | wnbell | 2008-10-05 11:28:14 +0900 (Sun, 05 Oct 2008) | 2 lines
  
  renamed diags to offsets to avoid possible confusion
........
  r4774 | alan.mcintyre | 2008-10-05 12:36:54 +0900 (Sun, 05 Oct 2008) | 2 lines
  
  Don't print debug information for low verbosity.
........
  r4775 | matthew.brett@gmail.com | 2008-10-05 13:49:23 +0900 (Sun, 05 Oct 2008) | 1 line
  
  Fixing long-broken mio tests
........
  r4781 | matthew.brett@gmail.com | 2008-10-05 18:36:46 +0900 (Sun, 05 Oct 2008) | 1 line
  
  Removed m files; now moved to matlab test directory
........
  r4783 | matthew.brett@gmail.com | 2008-10-06 01:55:22 +0900 (Mon, 06 Oct 2008) | 1 line
  
  Take matlab io tests out for now, known to fail (and have been failing silently for a long time)
........
  r4784 | wnbell | 2008-10-06 13:29:46 +0900 (Mon, 06 Oct 2008) | 2 lines
  
  added csr_toell()
........
  r4785 | wnbell | 2008-10-06 16:36:43 +0900 (Mon, 06 Oct 2008) | 2 lines
  
  writing of MatrixMarket now works for all integer kinds
........
  r4786 | uwe.schmitt | 2008-10-06 20:49:39 +0900 (Mon, 06 Oct 2008) | 1 line
  
  fixed comments in test_nnls.py
........
  r4787 | peridot | 2008-10-09 14:26:59 +0900 (Thu, 09 Oct 2008) | 2 lines
  
  Fixed and installed tests for scipy.stats.vonmises. Closes tickets #747, #748, and #749.
........
  r4788 | peridot | 2008-10-09 16:29:54 +0900 (Thu, 09 Oct 2008) | 4 lines
  
  Replaced implementation of von Mises CDF with cython implementation that should have better numerical performance. Note that for large k it uses array operations rather than cython code since we need scipy.stats.norm.cdf and scipy.special.i0. 
  
  Note also that the C code is *not* automatically rebuilt when the cython code changes.
........
  r4789 | wnbell | 2008-10-10 12:17:27 +0900 (Fri, 10 Oct 2008) | 2 lines
  
  (hopefully) fix ticket #736
........
  r4790 | cdavid | 2008-10-10 16:00:56 +0900 (Fri, 10 Oct 2008) | 1 line
  
  Update numscons build to cope with recent changes in scipy.interpolate.
........
  r4791 | cdavid | 2008-10-10 16:02:20 +0900 (Fri, 10 Oct 2008) | 1 line
  
  Update numscons build of scipy.ndimage.
........
  r4792 | wnbell | 2008-10-11 02:13:10 +0900 (Sat, 11 Oct 2008) | 2 lines
  
  fix CSR[:,array([1,2])] slicing problem
........
  r4793 | wnbell | 2008-10-11 19:36:17 +0900 (Sat, 11 Oct 2008) | 2 lines
  
  added missing import
........
  r4798 | cdavid | 2008-10-17 19:34:01 +0900 (Fri, 17 Oct 2008) | 1 line
  
  Add a dummy pavement file.
........
  r4799 | cdavid | 2008-10-17 19:34:18 +0900 (Fri, 17 Oct 2008) | 1 line
  
  The pavement file can now bootstrap the sources.
........
  r4800 | cdavid | 2008-10-17 19:38:23 +0900 (Fri, 17 Oct 2008) | 1 line
  
  Trailing spaces.
........
  r4801 | cdavid | 2008-10-17 19:44:28 +0900 (Fri, 17 Oct 2008) | 1 line
  
  Bootstrap is now working with paver.
........
  r4802 | wnbell | 2008-10-20 06:18:35 +0900 (Mon, 20 Oct 2008) | 7 lines
  
  added DOK matrix patch by James Philbin
  
  i. Improved the docstring.
  ii. Fixed the constructor (this fixes #755).
  iii. Reduced the codepath for the common case of setting an individual element (~2x speedup).
........
  r4803 | cdavid | 2008-10-21 13:04:36 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Add clean_bootstrap task.
........
  r4804 | cdavid | 2008-10-21 14:09:27 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Cosmetic change to pavement file.
........
  r4805 | cdavid | 2008-10-21 14:11:03 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Start the build task.
........
  r4806 | cdavid | 2008-10-21 14:31:55 +0900 (Tue, 21 Oct 2008) | 1 line
  
  More on build.
........
  r4807 | cdavid | 2008-10-21 14:44:14 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Rename pavement build task to build_binary.
........
  r4808 | cdavid | 2008-10-21 14:58:20 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Add bootstrap_arch task.
........
  r4809 | cdavid | 2008-10-21 15:13:48 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Re-enable the build log.
........
  r4810 | cdavid | 2008-10-21 15:23:28 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Bootstrap build now OK.
........
  r4811 | cdavid | 2008-10-21 15:26:54 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Fix clean_bootstrap task.
........
  r4812 | cdavid | 2008-10-21 15:43:17 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Generate nsis script in bootstrap task.
........
  r4813 | cdavid | 2008-10-21 16:22:36 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Fix nsis script generation.
........
  r4814 | cdavid | 2008-10-21 16:26:04 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Make build_binary a raw task.
........
  r4815 | cdavid | 2008-10-21 16:36:36 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Better error checking when running scipy setup.py from paver.
........
  r4816 | cdavid | 2008-10-21 18:28:34 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Put clean action into separate function.
........
  r4817 | cdavid | 2008-10-21 18:30:05 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Put clean_bootstrap action into separate function.
........
  r4818 | cdavid | 2008-10-21 18:39:47 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Build nsis installer should work now.
........
  r4819 | cdavid | 2008-10-21 18:55:54 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Fix wrong order of dependencies for build_nsis task.
........
  r4820 | cdavid | 2008-10-21 18:58:35 +0900 (Tue, 21 Oct 2008) | 1 line
  
  nsis_script preparation is common to all arches.
........
  r4821 | cdavid | 2008-10-21 19:40:18 +0900 (Tue, 21 Oct 2008) | 1 line
  
  nsis task to build the nsis installer from scratch should now work.
........
  r4822 | cdavid | 2008-10-21 19:46:57 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Disable LZMA compressor for scipy nsis installer: do not give much, and is slow.
........
  r4823 | cdavid | 2008-10-21 19:51:18 +0900 (Tue, 21 Oct 2008) | 1 line
  
  Remove unused code.
........
  r4824 | cdavid | 2008-10-22 17:15:58 +0900 (Wed, 22 Oct 2008) | 1 line
  
  Use np instead of numpy in morestats.
........
  r4825 | cdavid | 2008-10-22 17:29:55 +0900 (Wed, 22 Oct 2008) | 1 line
  
  Replace numpy imports with np.
........
  r4826 | cdavid | 2008-10-22 17:31:32 +0900 (Wed, 22 Oct 2008) | 1 line
  
  Revert bogus change.
........
  r4827 | cdavid | 2008-10-22 22:52:41 +0900 (Wed, 22 Oct 2008) | 1 line
  
  Emit a warning if numpy is < 1.2.0.
........



Property changes on: branches/refactor_fft
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/sparse_build_reduce_mem:1-4005 /branches/testing_cleanup:1-3662 /trunk:1-4693
   + /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/sparse_build_reduce_mem:1-4005 /branches/testing_cleanup:1-3662 /trunk:1-4827

Modified: branches/refactor_fft/THANKS.txt
===================================================================
--- branches/refactor_fft/THANKS.txt	2008-10-22 13:52:41 UTC (rev 4827)
+++ branches/refactor_fft/THANKS.txt	2008-10-23 12:30:20 UTC (rev 4828)
@@ -30,7 +30,8 @@
 Travis Vaught       -- initial work on stats module clean up
 Jeff Whitaker       -- Mac OS X support
 David Cournapeau    -- bug-fixes, refactor of fftpack and cluster, numscons build.
-Damian Eads         -- hiearchical clustering
+Damian Eads         -- hierarchical clustering, dendrogram plotting,
+                       distance functions, vq documentation
 
 
 Testing:

Modified: branches/refactor_fft/scipy/__init__.py
===================================================================
--- branches/refactor_fft/scipy/__init__.py	2008-10-22 13:52:41 UTC (rev 4827)
+++ branches/refactor_fft/scipy/__init__.py	2008-10-23 12:30:20 UTC (rev 4828)
@@ -28,8 +28,15 @@
 from numpy.random import rand, randn
 from numpy.fft import fft, ifft
 from numpy.lib.scimath import *
-_num.seterr(all='ignore')
 
+# Emit a warning if numpy is too old
+majver, minver = [float(i) for i in _num.version.version.split('.')[:2]]
+if majver < 1 or (majver == 1 and minver < 2):
+    import warnings
+    warnings.warn("Numpy 1.2.0 or above is recommended for this version of " \
+                  "scipy (detected version %s)" % _num.version.version,
+                  UserWarning)
+
 __all__ += ['oldnumeric']+_num.__all__
 
 __all__ += ['randn', 'rand', 'fft', 'ifft']
@@ -67,7 +74,7 @@
 # Remove subpackage names from __all__ such that they are not imported via
 # "from scipy import *". This works around a numpy bug present in < 1.2.
 subpackages = """cluster constants fftpack integrate interpolate io lib linalg
-linsolve maxentropy misc ndimage odr optimize signal sparse special
+linsolve maxentropy misc ndimage odr optimize signal sparse special 
 splinalg stats stsci weave""".split()
 for name in subpackages:
     try:

Modified: branches/refactor_fft/scipy/cluster/distance.py
===================================================================
--- branches/refactor_fft/scipy/cluster/distance.py	2008-10-22 13:52:41 UTC (rev 4827)
+++ branches/refactor_fft/scipy/cluster/distance.py	2008-10-23 12:30:20 UTC (rev 4828)
@@ -193,12 +193,41 @@
        d : double
            The Minkowski distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     if p < 1:
         raise ValueError("p must be at least 1")
     return (abs(u-v)**p).sum() ** (1.0 / p)
 
+def wminkowski(u, v, p, w):
+    """
+    Computes the weighted Minkowski distance between two vectors ``u``
+    and ``v``, defined as
+
+    .. math::
+
+       \sum {(w_i*|u_i - v_i|)^p})^(1/p).
+
+    :Parameters:
+       u : ndarray
+           An :math:`n`-dimensional vector.
+       v : ndarray
+           An :math:`n`-dimensional vector.
+       p : ndarray
+           The norm of the difference :math:`${||u-v||}_p$`.
+       w : ndarray
+           The weight vector.
+
+    :Returns:
+       d : double
+           The Minkowski distance between vectors ``u`` and ``v``.
+    """
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
+    if p < 1:
+        raise ValueError("p must be at least 1")
+    return ((w * abs(u-v))**p).sum() ** (1.0 / p)
+
 def euclidean(u, v):
     """
     Computes the Euclidean distance between two n-vectors ``u`` and ``v``,
@@ -218,8 +247,8 @@
        d : double
            The Euclidean distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     q=np.matrix(u-v)
     return np.sqrt((q*q.T).sum())
 
@@ -243,8 +272,8 @@
        d : double
            The squared Euclidean distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     return ((u-v)*(u-v).T).sum()
 
 def cosine(u, v):
@@ -266,8 +295,8 @@
        d : double
            The Cosine distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     return (1.0 - (np.dot(u, v.T) / \
                    (np.sqrt(np.dot(u, u.T)) * np.sqrt(np.dot(v, v.T)))))
 
@@ -327,8 +356,8 @@
        d : double
            The Hamming distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     return (u != v).mean()
 
 def jaccard(u, v):
@@ -355,8 +384,8 @@
        d : double
            The Jaccard distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     return (np.double(np.bitwise_and((u != v),
                      np.bitwise_or(u != 0, v != 0)).sum())
             /  np.double(np.bitwise_or(u != 0, v != 0).sum()))
@@ -385,8 +414,8 @@
        d : double
            The Kulsinski distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     n = len(u)
     (nff, nft, ntf, ntt) = _nbool_correspond_all(u, v)
 
@@ -409,9 +438,9 @@
        d : double
            The standardized Euclidean distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
-    V = np.asarray(V)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
+    V = np.asarray(V, order='c')
     if len(V.shape) != 1 or V.shape[0] != u.shape[0] or u.shape[0] != v.shape[0]:
         raise TypeError('V must be a 1-D array of the same dimension as u and v.')
     return np.sqrt(((u-v)**2 / V).sum())
@@ -435,8 +464,8 @@
        d : double
            The City Block distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     return abs(u-v).sum()
 
 def mahalanobis(u, v, VI):
@@ -459,9 +488,9 @@
        d : double
            The Mahalanobis distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
-    VI = np.asarray(VI)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
+    VI = np.asarray(VI, order='c')
     return np.sqrt(np.dot(np.dot((u-v),VI),(u-v).T).sum())
 
 def chebyshev(u, v):
@@ -482,8 +511,8 @@
        d : double
            The Chebyshev distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     return max(abs(u-v))
 
 def braycurtis(u, v):
@@ -505,8 +534,8 @@
        d : double
            The Bray-Curtis distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     return abs(u-v).sum() / abs(u+v).sum()
 
 def canberra(u, v):
@@ -530,8 +559,8 @@
        d : double
            The Canberra distance between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     return abs(u-v).sum() / (abs(u).sum() + abs(v).sum())
 
 def _nbool_correspond_all(u, v):
@@ -597,8 +626,8 @@
        d : double
            The Yule dissimilarity between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     (nff, nft, ntf, ntt) = _nbool_correspond_all(u, v)
     return float(2.0 * ntf * nft) / float(ntt * nff + ntf * nft)
 
@@ -625,8 +654,8 @@
        d : double
            The Matching dissimilarity between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     (nft, ntf) = _nbool_correspond_ft_tf(u, v)
     return float(nft + ntf) / float(len(u))
 
@@ -654,8 +683,8 @@
        d : double
            The Dice dissimilarity between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     if u.dtype == np.bool:
         ntt = (u & v).sum()
     else:
@@ -687,8 +716,8 @@
            The Rogers-Tanimoto dissimilarity between vectors
            ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     (nff, nft, ntf, ntt) = _nbool_correspond_all(u, v)
     return float(2.0 * (ntf + nft)) / float(ntt + nff + (2.0 * (ntf + nft)))
 
@@ -716,8 +745,8 @@
        d : double
            The Russell-Rao dissimilarity between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     if u.dtype == np.bool:
         ntt = (u & v).sum()
     else:
@@ -749,8 +778,8 @@
        d : double
            The Sokal-Michener dissimilarity between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     if u.dtype == np.bool:
         ntt = (u & v).sum()
         nff = (~u & ~v).sum()
@@ -784,8 +813,8 @@
        d : double
            The Sokal-Sneath dissimilarity between vectors ``u`` and ``v``.
     """
-    u = np.asarray(u)
-    v = np.asarray(v)
+    u = np.asarray(u, order='c')
+    v = np.asarray(v, order='c')
     if u.dtype == np.bool:
         ntt = (u & v).sum()
     else:
@@ -796,7 +825,7 @@
 
 def pdist(X, metric='euclidean', p=2, V=None, VI=None):
     """
-    Computes the distance between m original observations in
+    Computes the pairwise distances between m original observations in
     n-dimensional space. Returns a condensed distance matrix Y.  For
     each :math:`$i$` and :math:`$j$` (where :math:`$i<j<n$), the
     metric ``dist(u=X[i], v=X[j])`` is computed and stored in the
@@ -817,6 +846,14 @@
            'jaccard', 'kulsinski', 'mahalanobis', 'matching',
            'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean',
            'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule'.
+       w : ndarray
+           The weight vector (for weighted Minkowski).
+       p : double
+           The p-norm to apply (for Minkowski, weighted and unweighted)
+       V : ndarray
+           The variance vector (for standardized Euclidean).
+       VI : ndarray
+           The inverse of the covariance matrix (for Mahalanobis).
 
     :Returns:
        Y : ndarray
@@ -978,6 +1015,11 @@
        Computes the Sokal-Sneath distance between each pair of
        boolean vectors. (see sokalsneath function documentation)
 
+    22. ``Y = pdist(X, 'wminkowski')``
+
+       Computes the weighted Minkowski distance between each pair of
+       vectors. (see wminkowski function documentation)
+
     22. ``Y = pdist(X, f)``
 
        Computes the distance between all pairs of vectors in X
@@ -1001,6 +1043,8 @@
          dm = pdist(X, 'sokalsneath')
 
        """
+
+
 #         21. Y = pdist(X, 'test_Y')
 #
 #           Computes the distance between all pairs of vectors in X
@@ -1008,7 +1052,7 @@
 #           verifiable, but less efficient implementation.
 
 
-    X = np.asarray(X)
+    X = np.asarray(X, order='c')
 
     #if np.issubsctype(X, np.floating) and not np.issubsctype(X, np.double):
     #    raise TypeError('Floating point arrays must be 64-bit (got %r).' %
@@ -1034,6 +1078,11 @@
                 for j in xrange(i+1, m):
                     dm[k] = minkowski(X[i, :], X[j, :], p)
                     k = k + 1
+        elif metric == wminkowski:
+            for i in xrange(0, m - 1):
+                for j in xrange(i+1, m):
+                    dm[k] = wminkowski(X[i, :], X[j, :], p, w)
+                    k = k + 1
         elif metric == seuclidean:
             for i in xrange(0, m - 1):
                 for j in xrange(i+1, m):
@@ -1077,9 +1126,12 @@
             _distance_wrap.pdist_chebyshev_wrap(_convert_to_double(X), dm)
         elif mstr in set(['minkowski', 'mi', 'm']):
             _distance_wrap.pdist_minkowski_wrap(_convert_to_double(X), dm, p)
+        elif mstr in set(['wminkowski', 'wmi', 'wm', 'wpnorm']):
+            _distance_wrap.cdist_weighted_minkowski_wrap(_convert_to_double(X),
+                                                         dm, p, w)
         elif mstr in set(['seuclidean', 'se', 's']):
             if V is not None:
-                V = np.asarray(V)
+                V = np.asarray(V, order='c')
                 if type(V) != np.ndarray:
                     raise TypeError('Variance vector V must be a numpy array')
                 if V.dtype != np.double:
@@ -1117,7 +1169,7 @@
             _distance_wrap.pdist_cosine_wrap(_convert_to_double(X2), _convert_to_double(dm), _convert_to_double(norms))
         elif mstr in set(['mahalanobis', 'mahal', 'mah']):
             if VI is not None:
-                VI = _convert_to_double(np.asarray(VI))
+                VI = _convert_to_double(np.asarray(VI, order='c'))
                 if type(VI) != np.ndarray:
                     raise TypeError('VI must be a numpy array.')
                 if VI.dtype != np.double:
@@ -1131,7 +1183,7 @@
         elif mstr == 'canberra':
             _distance_wrap.pdist_canberra_wrap(_convert_to_double(X), dm)
         elif mstr == 'braycurtis':
-            _distance_wrap.pdist_bray_curtis_wrap(_convert_to_bool(X), dm)
+            _distance_wrap.pdist_bray_curtis_wrap(_convert_to_double(X), dm)
         elif mstr == 'yule':
             _distance_wrap.pdist_yule_bool_wrap(_convert_to_bool(X), dm)
         elif mstr == 'matching':
@@ -1154,7 +1206,7 @@
             if V is None:
                 V = np.var(X, axis=0, ddof=1)
             else:
-                V = np.asarray(V)
+                V = np.asarray(V, order='c')
             dm = pdist(X, lambda u, v: seuclidean(u, v, V))
         elif metric == 'test_braycurtis':
             dm = pdist(X, braycurtis)
@@ -1163,7 +1215,7 @@
                 V = np.cov(X.T)
                 VI = np.linalg.inv(V)
             else:
-                VI = np.asarray(VI)
+                VI = np.asarray(VI, order='c')
             [VI] = _copy_arrays_if_base_present([VI])
             # (u-v)V^(-1)(u-v)^T
             dm = pdist(X, (lambda u, v: mahalanobis(u, v, VI)))
@@ -1172,7 +1224,9 @@
         elif metric == 'test_cityblock':
             dm = pdist(X, cityblock)
         elif metric == 'test_minkowski':
-            dm = pdist(X, minkowski, p)
+            dm = pdist(X, minkowski, p=p)
+        elif metric == 'test_wminkowski':
+            dm = pdist(X, wminkowski, p=p, w=w)
         elif metric == 'test_cosine':
             dm = pdist(X, cosine)
         elif metric == 'test_correlation':
@@ -1204,6 +1258,7 @@
     else:
         raise TypeError('2nd argument metric must be a string identifier or a function.')
     return dm
+
 def squareform(X, force="no", checks=True):
     """
     Converts a vector-form distance vector to a square-form distance
@@ -1255,7 +1310,7 @@
 
     """
 
-    X = _convert_to_double(np.asarray(X))
+    X = _convert_to_double(np.asarray(X, order='c'))
 
     if not np.issubsctype(X, np.double):
         raise TypeError('A double array must be passed.')
@@ -1353,7 +1408,7 @@
        ``D.T`` and non-zeroness of the diagonal are ignored if they are
        within the tolerance specified by ``tol``.
     """
-    D = np.asarray(D)
+    D = np.asarray(D, order='c')
     valid = True
     try:
         if type(D) != np.ndarray:
@@ -1429,7 +1484,7 @@
            warning or exception message.
 
     """
-    y = np.asarray(y)
+    y = np.asarray(y, order='c')
     valid = True
     try:
         if type(y) != np.ndarray:
@@ -1474,7 +1529,7 @@
     :Returns:
        The number of observations in the redundant distance matrix.
     """
-    D = np.asarray(D)
+    D = np.asarray(D, order='c')
     is_valid_dm(D, tol=np.inf, throw=True, name='D')
     return D.shape[0]
 
@@ -1493,7 +1548,485 @@
            The number of observations in the condensed distance matrix
            passed.
     """
-    Y = np.asarray(Y)
+    Y = np.asarray(Y, order='c')
     is_valid_y(Y, throw=True, name='Y')
     d = int(np.ceil(np.sqrt(Y.shape[0] * 2)))
     return d
+
+
+def cdist(XA, XB, metric='euclidean', p=2, V=None, VI=None, w=None):
+    """
+    Computes distance between each pair of observations between two
+    collections of vectors. ``XA`` is a :math:`$m_A$` by :math:`$n$`
+    array while ``XB`` is a :math:`$m_B$` by :math:`$n$` array. A
+    :math:`$m_A$` by :math:`$m_B$` array is returned. An exception is
+    thrown if ``XA`` and ``XB`` do not have the same number of
+    columns.
+
+    A rectangular distance matrix Y is returned. For each :math:`$i$`
+    and :math:`$j$`, the metric ``dist(u=XA[i], v=XB[j])`` is computed
+    and stored in the :math:`ij`th entry.
+
+
+    :Parameters:
+       XA : ndarray
+           An :math:`$m_A$` by :math:`$n$` array of :math:`$m_A$`
+           original observations in an n-dimensional space.
+       XB : ndarray
+           An :math:`$m_B$` by :math:`$n$` array of :math:`$m_B$`
+           original observations in an n-dimensional space.
+       metric : string or function
+           The distance metric to use. The distance function can
+           be 'braycurtis', 'canberra', 'chebyshev', 'cityblock',
+           'correlation', 'cosine', 'dice', 'euclidean', 'hamming',
+           'jaccard', 'kulsinski', 'mahalanobis', 'matching',
+           'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean',
+           'sokalmichener', 'sokalsneath', 'sqeuclidean', 'wminkowski',
+           'yule'.
+       w : ndarray
+           The weight vector (for weighted Minkowski).
+       p : double
+           The p-norm to apply (for Minkowski, weighted and unweighted)
+       V : ndarray
+           The variance vector (for standardized Euclidean).
+       VI : ndarray
+           The inverse of the covariance matrix (for Mahalanobis).
+
+
+    :Returns:
+       Y : ndarray
+           A :math:`$m_A$` by :math:`$m_B$` distance matrix.
+
+    Calling Conventions
+    -------------------
+
+    1. ``Y = cdist(X, 'euclidean')``
+
+       Computes the distance between m points using Euclidean distance
+       (2-norm) as the distance metric between the points. The points
+       are arranged as m n-dimensional row vectors in the matrix X.
+
+    2. ``Y = cdist(X, 'minkowski', p)``
+
+       Computes the distances using the Minkowski distance
+       :math:`$||u-v||_p$` (p-norm) where :math:`$p \geq 1$`.
+
+    3. ``Y = cdist(X, 'cityblock')``
+
+       Computes the city block or Manhattan distance between the
+       points.
+
+    4. ``Y = cdist(X, 'seuclidean', V=None)``
+
+       Computes the standardized Euclidean distance. The standardized
+       Euclidean distance between two n-vectors ``u`` and ``v`` is
+
+       .. math:
+
+          sqrt(\sum {(u_i-v_i)^2 / V[x_i]}).
+
+       V is the variance vector; V[i] is the variance computed over all
+          the i'th components of the points. If not passed, it is
+          automatically computed.
+
+    5. ``Y = cdist(X, 'sqeuclidean')``
+
+       Computes the squared Euclidean distance ||u-v||_2^2 between
+       the vectors.
+
+    6. ``Y = cdist(X, 'cosine')``
+
+       Computes the cosine distance between vectors u and v,
+
+       .. math:
+
+          \frac{1 - uv^T}
+               {{|u|}_2 {|v|}_2}
+
+       where |*|_2 is the 2 norm of its argument *.
+
+    7. ``Y = cdist(X, 'correlation')``
+
+       Computes the correlation distance between vectors u and v. This is
+
+       .. math:
+
+          \frac{1 - (u - n{|u|}_1){(v - n{|v|}_1)}^T}
+               {{|(u - n{|u|}_1)|}_2 {|(v - n{|v|}_1)|}^T}
+
+       where :math:`$|*|_1$` is the Manhattan (or 1-norm) of its
+       argument, and :math:`$n$` is the common dimensionality of the
+       vectors.
+
+    8. ``Y = cdist(X, 'hamming')``
+
+       Computes the normalized Hamming distance, or the proportion of
+       those vector elements between two n-vectors ``u`` and ``v``
+       which disagree. To save memory, the matrix ``X`` can be of type
+       boolean.
+
+    9. ``Y = cdist(X, 'jaccard')``
+
+       Computes the Jaccard distance between the points. Given two
+       vectors, ``u`` and ``v``, the Jaccard distance is the
+       proportion of those elements ``u[i]`` and ``v[i]`` that
+       disagree where at least one of them is non-zero.
+
+    10. ``Y = cdist(X, 'chebyshev')``
+
+       Computes the Chebyshev distance between the points. The
+       Chebyshev distance between two n-vectors ``u`` and ``v`` is the
+       maximum norm-1 distance between their respective elements. More
+       precisely, the distance is given by
+
+       .. math:
+
+          d(u,v) = max_i {|u_i-v_i|}.
+
+    11. ``Y = cdist(X, 'canberra')``
+
+       Computes the Canberra distance between the points. The
+       Canberra distance between two points ``u`` and ``v`` is
+
+       .. math:
+
+         d(u,v) = \sum_u {|u_i-v_i|}
+                         {|u_i|+|v_i|}
+                         
+
+    12. ``Y = cdist(X, 'braycurtis')``
+
+       Computes the Bray-Curtis distance between the points. The
+       Bray-Curtis distance between two points ``u`` and ``v`` is
+
+
+       .. math:
+
+            d(u,v) = \frac{\sum_i {u_i-v_i}}
+                          {\sum_i {u_i+v_i}}
+
+    13. ``Y = cdist(X, 'mahalanobis', VI=None)``
+
+       Computes the Mahalanobis distance between the points. The
+       Mahalanobis distance between two points ``u`` and ``v`` is
+       :math:`$(u-v)(1/V)(u-v)^T$` where :math:`$(1/V)$` (the ``VI``
+       variable) is the inverse covariance. If ``VI`` is not None,
+       ``VI`` will be used as the inverse covariance matrix.
+
+    14. ``Y = cdist(X, 'yule')``
+
+       Computes the Yule distance between each pair of boolean
+       vectors. (see yule function documentation)
+
+    15. ``Y = cdist(X, 'matching')``
+
+       Computes the matching distance between each pair of boolean
+       vectors. (see matching function documentation)
+
+    16. ``Y = cdist(X, 'dice')``
+
+       Computes the Dice distance between each pair of boolean
+       vectors. (see dice function documentation)
+
+    17. ``Y = cdist(X, 'kulsinski')``
+
+       Computes the Kulsinski distance between each pair of
+       boolean vectors. (see kulsinski function documentation)
+
+    18. ``Y = cdist(X, 'rogerstanimoto')``
+
+       Computes the Rogers-Tanimoto distance between each pair of
+       boolean vectors. (see rogerstanimoto function documentation)
+
+    19. ``Y = cdist(X, 'russellrao')``
+
+       Computes the Russell-Rao distance between each pair of
+       boolean vectors. (see russellrao function documentation)
+
+    20. ``Y = cdist(X, 'sokalmichener')``
+
+       Computes the Sokal-Michener distance between each pair of
+       boolean vectors. (see sokalmichener function documentation)
+
+    21. ``Y = cdist(X, 'sokalsneath')``
+
+       Computes the Sokal-Sneath distance between the vectors. (see
+       sokalsneath function documentation)
+
+
+    22. ``Y = cdist(X, 'wminkowski')``
+
+       Computes the weighted Minkowski distance between the
+       vectors. (see sokalsneath function documentation)
+
+    23. ``Y = cdist(X, f)``
+
+       Computes the distance between all pairs of vectors in X
+       using the user supplied 2-arity function f. For example,
+       Euclidean distance between the vectors could be computed
+       as follows::
+
+         dm = cdist(X, (lambda u, v: np.sqrt(((u-v)*(u-v).T).sum())))
+
+       Note that you should avoid passing a reference to one of
+       the distance functions defined in this library. For example,::
+
+         dm = cdist(X, sokalsneath)
+
+       would calculate the pair-wise distances between the vectors in
+       X using the Python function sokalsneath. This would result in
+       sokalsneath being called :math:`${n \choose 2}$` times, which
+       is inefficient. Instead, the optimized C version is more
+       efficient, and we call it using the following syntax.::
+
+         dm = cdist(X, 'sokalsneath')
+
+       """
+
+
+#         21. Y = cdist(X, 'test_Y')
+#
+#           Computes the distance between all pairs of vectors in X
+#           using the distance metric Y but with a more succint,
+#           verifiable, but less efficient implementation.
+
+
+    XA = np.asarray(XA, order='c')
+    XB = np.asarray(XB, order='c')
+
+    #if np.issubsctype(X, np.floating) and not np.issubsctype(X, np.double):
+    #    raise TypeError('Floating point arrays must be 64-bit (got %r).' %
+    #    (X.dtype.type,))
+
+    # The C code doesn't do striding.
+    [XA] = _copy_arrays_if_base_present([_convert_to_double(XA)])
+    [XB] = _copy_arrays_if_base_present([_convert_to_double(XB)])
+
+    s = XA.shape
+    sB = XB.shape
+
+    if len(s) != 2:
+        raise ValueError('XA must be a 2-dimensional array.');
+    if len(sB) != 2:
+        raise ValueError('XB must be a 2-dimensional array.');
+    if s[1] != sB[1]:
+        raise ValueError('XA and XB must have the same number of columns (i.e. feature dimension.)')
+
+    mA = s[0]
+    mB = sB[0]
+    n = s[1]
+    dm = np.zeros((mA, mB), dtype=np.double)
+
+    mtype = type(metric)
+    if mtype is types.FunctionType:
+        if metric == minkowski:
+            for i in xrange(0, mA):
+                for j in xrange(0, mB):
+                    dm[i, j] = minkowski(XA[i, :], XB[j, :], p)
+        elif metric == wminkowski:
+            for i in xrange(0, mA):
+                for j in xrange(0, mB):
+                    dm[i, j] = wminkowski(XA[i, :], XB[j, :], p, w)
+        elif metric == seuclidean:
+            for i in xrange(0, mA):
+                for j in xrange(0, mB):
+                    dm[i, j] = seuclidean(XA[i, :], XB[j, :], V)
+        elif metric == mahalanobis:
+            for i in xrange(0, mA):
+                for j in xrange(0, mB):
+                    dm[i, j] = mahalanobis(XA[i, :], XB[j, :], V)
+        else:
+            for i in xrange(0, mA):
+                for j in xrange(0, mB):
+                    dm[i, j] = metric(XA[i, :], XB[j, :])
+    elif mtype is types.StringType:
+        mstr = metric.lower()
+
+        #if XA.dtype != np.double and \
+        #       (mstr != 'hamming' and mstr != 'jaccard'):
+        #    TypeError('A double array must be passed.')
+        if mstr in set(['euclidean', 'euclid', 'eu', 'e']):
+            _distance_wrap.cdist_euclidean_wrap(_convert_to_double(XA),
+                                                _convert_to_double(XB), dm)
+        elif mstr in set(['sqeuclidean', 'sqe', 'sqeuclid']):
+            _distance_wrap.cdist_euclidean_wrap(_convert_to_double(XA),
+                                                _convert_to_double(XB), dm)
+            dm **= 2.0
+        elif mstr in set(['cityblock', 'cblock', 'cb', 'c']):
+            _distance_wrap.cdist_city_block_wrap(_convert_to_double(XA),
+                                                 _convert_to_double(XB), dm)
+        elif mstr in set(['hamming', 'hamm', 'ha', 'h']):
+            if XA.dtype == np.bool:
+                _distance_wrap.cdist_hamming_bool_wrap(_convert_to_bool(XA),
+                                                       _convert_to_bool(XB), dm)
+            else:
+                _distance_wrap.cdist_hamming_wrap(_convert_to_double(XA),
+                                                  _convert_to_double(XB), dm)
+        elif mstr in set(['jaccard', 'jacc', 'ja', 'j']):
+            if XA.dtype == np.bool:
+                _distance_wrap.cdist_jaccard_bool_wrap(_convert_to_bool(XA),
+                                                       _convert_to_bool(XB), dm)
+            else:
+                _distance_wrap.cdist_jaccard_wrap(_convert_to_double(XA),
+                                                  _convert_to_double(XB), dm)
+        elif mstr in set(['chebychev', 'chebyshev', 'cheby', 'cheb', 'ch']):
+            _distance_wrap.cdist_chebyshev_wrap(_convert_to_double(XA),
+                                                _convert_to_double(XB), dm)
+        elif mstr in set(['minkowski', 'mi', 'm', 'pnorm']):
+            _distance_wrap.cdist_minkowski_wrap(_convert_to_double(XA),
+                                                _convert_to_double(XB), dm, p)
+        elif mstr in set(['wminkowski', 'wmi', 'wm', 'wpnorm']):
+            _distance_wrap.cdist_weighted_minkowski_wrap(_convert_to_double(XA),
+                                                         _convert_to_double(XB), dm, p, _convert_to_double(w))
+        elif mstr in set(['seuclidean', 'se', 's']):
+            if V is not None:
+                V = np.asarray(V, order='c')
+                if type(V) != np.ndarray:
+                    raise TypeError('Variance vector V must be a numpy array')
+                if V.dtype != np.double:
+                    raise TypeError('Variance vector V must contain doubles.')
+                if len(V.shape) != 1:
+                    raise ValueError('Variance vector V must be one-dimensional.')
+                if V.shape[0] != n:
+                    raise ValueError('Variance vector V must be of the same dimension as the vectors on which the distances are computed.')
+                # The C code doesn't do striding.
+                [VV] = _copy_arrays_if_base_present([_convert_to_double(V)])
+            else:
+                X = np.vstack([XA, XB])
+                VV = np.var(X, axis=0, ddof=1)
+                X = None
+                del X
+            _distance_wrap.cdist_seuclidean_wrap(_convert_to_double(XA),
+                                                 _convert_to_double(XB), VV, dm)
+        # Need to test whether vectorized cosine works better.
+        # Find out: Is there a dot subtraction operator so I can
+        # subtract matrices in a similar way to multiplying them?
+        # Need to get rid of as much unnecessary C code as possible.
+        elif mstr in set(['cosine', 'cos']):
+            normsA = np.sqrt(np.sum(XA * XA, axis=1))
+            normsB = np.sqrt(np.sum(XB * XB, axis=1))
+            _distance_wrap.cdist_cosine_wrap(_convert_to_double(XA),
+                                             _convert_to_double(XB), dm,
+                                             normsA,
+                                             normsB)
+        elif mstr in set(['correlation', 'co']):
+            XA2 = XA - XA.mean(1)[:,np.newaxis]
+            XB2 = XB - XB.mean(1)[:,np.newaxis]
+            #X2 = X - np.matlib.repmat(np.mean(X, axis=1).reshape(m, 1), 1, n)
+            normsA = np.sqrt(np.sum(XA2 * XA2, axis=1))
+            normsB = np.sqrt(np.sum(XB2 * XB2, axis=1))
+            _distance_wrap.cdist_cosine_wrap(_convert_to_double(XA2),
+                                             _convert_to_double(XB2),
+                                             _convert_to_double(dm),
+                                             _convert_to_double(normsA),
+                                             _convert_to_double(normsB))
+        elif mstr in set(['mahalanobis', 'mahal', 'mah']):
+            if VI is not None:
+                VI = _convert_to_double(np.asarray(VI, order='c'))
+                if type(VI) != np.ndarray:
+                    raise TypeError('VI must be a numpy array.')
+                if VI.dtype != np.double:
+                    raise TypeError('The array must contain 64-bit floats.')
+                [VI] = _copy_arrays_if_base_present([VI])
+            else:
+                X = np.vstack([XA, XB])
+                V = np.cov(X.T)
+                X = None
+                del X
+                VI = _convert_to_double(np.linalg.inv(V).T.copy())
+            # (u-v)V^(-1)(u-v)^T
+            _distance_wrap.cdist_mahalanobis_wrap(_convert_to_double(XA),
+                                                  _convert_to_double(XB), VI, dm)
+        elif mstr == 'canberra':
+            _distance_wrap.cdist_canberra_wrap(_convert_to_double(XA),
+                                               _convert_to_double(XB), dm)
+        elif mstr == 'braycurtis':
+            _distance_wrap.cdist_bray_curtis_wrap(_convert_to_double(XA),
+                                                  _convert_to_double(XB), dm)
+        elif mstr == 'yule':
+            _distance_wrap.cdist_yule_bool_wrap(_convert_to_bool(XA),
+                                                _convert_to_bool(XB), dm)
+        elif mstr == 'matching':
+            _distance_wrap.cdist_matching_bool_wrap(_convert_to_bool(XA),
+                                                    _convert_to_bool(XB), dm)
+        elif mstr == 'kulsinski':
+            _distance_wrap.cdist_kulsinski_bool_wrap(_convert_to_bool(XA),
+                                                     _convert_to_bool(XB), dm)
+        elif mstr == 'dice':
+            _distance_wrap.cdist_dice_bool_wrap(_convert_to_bool(XA),
+                                                _convert_to_bool(XB), dm)
+        elif mstr == 'rogerstanimoto':
+            _distance_wrap.cdist_rogerstanimoto_bool_wrap(_convert_to_bool(XA),
+                                                          _convert_to_bool(XB), dm)
+        elif mstr == 'russellrao':
+            _distance_wrap.cdist_russellrao_bool_wrap(_convert_to_bool(XA),
+                                                      _convert_to_bool(XB), dm)
+        elif mstr == 'sokalmichener':
+            _distance_wrap.cdist_sokalmichener_bool_wrap(_convert_to_bool(XA),
+                                                         _convert_to_bool(XB), dm)
+        elif mstr == 'sokalsneath':
+            _distance_wrap.cdist_sokalsneath_bool_wrap(_convert_to_bool(XA),
+                                                       _convert_to_bool(XB), dm)
+        elif metric == 'test_euclidean':
+            dm = cdist(XA, XB, euclidean)
+        elif metric == 'test_seuclidean':
+            if V is None:
+                V = np.var(np.vstack([XA, XB]), axis=0, ddof=1)
+            else:
+                V = np.asarray(V, order='c')
+            dm = cdist(XA, XB, lambda u, v: seuclidean(u, v, V))
+        elif metric == 'test_sqeuclidean':
+            dm = cdist(XA, XB, lambda u, v: sqeuclidean(u, v))
+        elif metric == 'test_braycurtis':
+            dm = cdist(XA, XB, braycurtis)
+        elif metric == 'test_mahalanobis':
+            if VI is None:
+                X = np.vstack([XA, XB])
+                V = np.cov(X.T)
+                VI = np.linalg.inv(V)
+                X = None
+                del X
+            else:
+                VI = np.asarray(VI, order='c')
+            [VI] = _copy_arrays_if_base_present([VI])
+            # (u-v)V^(-1)(u-v)^T
+            dm = cdist(XA, XB, (lambda u, v: mahalanobis(u, v, VI)))
+        elif metric == 'test_canberra':
+            dm = cdist(XA, XB, canberra)
+        elif metric == 'test_cityblock':
+            dm = cdist(XA, XB, cityblock)
+        elif metric == 'test_minkowski':
+            dm = cdist(XA, XB, minkowski, p=p)
+        elif metric == 'test_wminkowski':
+            dm = cdist(XA, XB, wminkowski, p=p, w=w)
+        elif metric == 'test_cosine':
+            dm = cdist(XA, XB, cosine)
+        elif metric == 'test_correlation':
+            dm = cdist(XA, XB, correlation)
+        elif metric == 'test_hamming':
+            dm = cdist(XA, XB, hamming)
+        elif metric == 'test_jaccard':
+            dm = cdist(XA, XB, jaccard)
+        elif metric == 'test_chebyshev' or metric == 'test_chebychev':
+            dm = cdist(XA, XB, chebyshev)
+        elif metric == 'test_yule':
+            dm = cdist(XA, XB, yule)
+        elif metric == 'test_matching':
+            dm = cdist(XA, XB, matching)
+        elif metric == 'test_dice':
+            dm = cdist(XA, XB, dice)
+        elif metric == 'test_kulsinski':
+            dm = cdist(XA, XB, kulsinski)
+        elif metric == 'test_rogerstanimoto':
+            dm = cdist(XA, XB, rogerstanimoto)
+        elif metric == 'test_russellrao':
+            dm = cdist(XA, XB, russellrao)
+        elif metric == 'test_sokalsneath':
+            dm = cdist(XA, XB, sokalsneath)
+        elif metric == 'test_sokalmichener':
+            dm = cdist(XA, XB, sokalmichener)
+        else:
+            raise ValueError('Unknown Distance Metric: %s' % mstr)
+    else:
+        raise TypeError('2nd argument metric must be a string identifier or a function.')
+    return dm

Modified: branches/refactor_fft/scipy/cluster/hierarchy.py
===================================================================
--- branches/refactor_fft/scipy/cluster/hierarchy.py	2008-10-22 13:52:41 UTC (rev 4827)
+++ branches/refactor_fft/scipy/cluster/hierarchy.py	2008-10-23 12:30:20 UTC (rev 4828)
@@ -577,7 +577,7 @@
     if not isinstance(method, str):
         raise TypeError("Argument 'method' must be a string.")
 
-    y = _convert_to_double(np.asarray(y))
+    y = _convert_to_double(np.asarray(y, order='c'))
 
     s = y.shape
     if len(s) == 1:
@@ -800,7 +800,7 @@
     library.
     """
 
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
 
     is_valid_linkage(Z, throw=True, name='Z')
 
@@ -866,48 +866,57 @@
 
 def cophenet(*args, **kwargs):
     """
+    Calculates the cophenetic distances between each observation in
+    the hierarchical clustering defined by the linkage ``Z``.
 
+    Suppose :math:`$p$` and :math:`$q$` are original observations in
+    disjoint clusters :math:`$s$` and :math:`$t$`, respectively and
+    :math:`$s$` and :math:`$t$` are joined by a direct parent cluster
+    :math:`$u$`. The cophenetic distance between observations
+    :math:`$i$` and :math:`$j$` is simply the distance between
+    clusters :math:`$s$` and :math:`$t$`.
 
+    :Parameters:
+       - Z : ndarray
+         The encoded linkage matrix on which to perform the calculation.
+
+       - Y : ndarray (optional)
+         Calculates the cophenetic correlation coefficient ``c`` of a
+         hierarchical clustering defined by the linkage matrix ``Z``
+         of a set of :math:`$n$` observations in :math:`$m$`
+         dimensions. ``Y`` is the condensed distance matrix from which
+         ``Z`` was generated. 
+
+    :Returns:
+       - c : ndarray
+         The cophentic correlation distance (if ``y`` is passed).
+ 
+       - d : ndarray
+         The cophenetic distance matrix in condensed form. The
+         :math:`$ij$`th entry is the cophenetic distance between
+         original observations :math:`$i$` and :math:`$j$`.
+
     Calling Conventions
     -------------------
 
       1. ``d = cophenet(Z)``
+         Returns just the cophentic distance matrix.
 
-      Calculates the cophenetic distances between each observation in the
-      hierarchical clustering defined by the linkage ``Z``.
-
-      Suppose :math:`$p$` and :math:`$q$` are original observations in
-      disjoint clusters :math:`$s$` and :math:`$t$`, respectively and
-      :math:`$s$` and :math:`$t$` are joined by a direct parent
-      cluster :math:`$u$`. The cophenetic distance between
-      observations :math:`$i$` and :math:`$j$` is simply the distance
-      between clusters :math:`$s$` and :math:`$t$`.
-
-      ``d`` is cophenetic distance matrix in condensed form. The
-      :math:`$ij$`th entry is the cophenetic distance between original
-      observations :math:`$i$` and :math:`$j$`.
-
       2. ``c = cophenet(Z, Y)``
+         Returns just the cophentic correlation coefficient.
 
-      Calculates the cophenetic correlation coefficient ``c`` of a
-      hierarchical clustering defined by the linkage matrix ``Z`` of a
-      set of :math:`$n$` observations in :math:`$m$` dimensions. ``Y``
-      is the condensed distance matrix from which ``Z`` was generated.
-
       3. ``(c, d) = cophenet(Z, Y, [])``
-
-      Returns a tuple instead, (c, d). The cophenetic distance matrix
-      ``d`` is included in condensed (upper triangular) form.
-
+         Returns a tuple, ``(c, d)`` where ``c`` is the cophenetic
+         correlation coefficient and ``d`` is the condensed cophentic
+         distance matrix (upper triangular form).
     """
-    Z = np.asarray(Z)
-
     nargs = len(args)
 
     if nargs < 1:
         raise ValueError('At least one argument must be passed to cophenet.')
 
     Z = args[0]
+    Z = np.asarray(Z, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
     Zs = Z.shape
     n = Zs[0] + 1
@@ -922,6 +931,7 @@
         return zz
 
     Y = args[1]
+    Y = np.asarray(Y, order='c')
     Ys = Y.shape
     distance.is_valid_y(Y, throw=True, name='Y')
 
@@ -943,23 +953,37 @@
 
 def inconsistent(Z, d=2):
     """
-    R = inconsistent(Z, d=2)
+    Calculates inconsistency statistics on a linkage.
 
-      Calculates statistics on links up to d levels below each
-      non-singleton cluster defined in the (n-1)x4 linkage matrix Z.
+    :Parameters:
+       - d : int
+           The number of links up to ``d`` levels below each
+           non-singleton cluster
 
-      R is a (n-1)x5 matrix where the i'th row contains the link
-      statistics for the non-singleton cluster i. The link statistics
-      are computed over the link heights for links d levels below the
-      cluster i. R[i,0] and R[i,1] are the mean and standard deviation of
-      the link heights, respectively; R[i,2] is the number of links
-      included in the calculation; and R[i,3] is the inconsistency
-      coefficient, (Z[i, 2]-R[i,0])/R[i,2].
+       - Z : ndarray
+           The :math:`$(n-1)$` by 4 matrix encoding the linkage
+           (hierarchical clustering).  See ``linkage`` documentation
+           for more information on its form.
+       
 
-      This function behaves similarly to the MATLAB(TM) inconsistent
-      function.
+    :Returns:
+       - R : ndarray
+           A :math:`$(n-1)$` by 5 matrix where the ``i``'th row
+           contains the link statistics for the non-singleton cluster
+           ``i``. The link statistics are computed over the link
+           heights for links :math:`$d$` levels below the cluster
+           ``i``. ``R[i,0]`` and ``R[i,1]`` are the mean and standard
+           deviation of the link heights, respectively; ``R[i,2]`` is
+           the number of links included in the calculation; and
+           ``R[i,3]`` is the inconsistency coefficient,
+           .. math:
+               \frac{\mathtt{Z[i,2]}-\mathtt{R[i,0]}}
+                    {R[i,2]}.
+
+    This function behaves similarly to the MATLAB(TM) inconsistent
+    function.
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
 
     Zs = Z.shape
     is_valid_linkage(Z, throw=True, name='Z')
@@ -980,19 +1004,31 @@
 
 def from_mlab_linkage(Z):
     """
-    Z2 = from_mlab_linkage(Z)
+    Converts a linkage matrix generated by MATLAB(TM) to a new
+    linkage matrix compatible with this module. The conversion does
+    two things:
 
-    Converts a linkage matrix Z generated by MATLAB(TM) to a new linkage
-    matrix Z2 compatible with this module. The conversion does two
-    things:
+     * the indices are converted from ``1..N`` to ``0..(N-1)`` form,
+       and
 
-     * the indices are converted from 1..N to 0..(N-1) form, and
+     * a fourth column Z[:,3] is added where Z[i,3] is represents the
+       number of original observations (leaves) in the non-singleton
+       cluster i.
 
-     * a fourth column Z[:,3] is added where Z[i,3] is equal to
-       the number of original observations (leaves) in the non-singleton
-       cluster i.
+    This function is useful when loading in linkages from legacy data
+    files generated by MATLAB.
+
+    :Arguments:
+
+       - Z : ndarray
+           A linkage matrix generated by MATLAB(TM)
+
+    :Returns:
+
+       - ZS : ndarray
+           A linkage matrix compatible with this library.
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
     Zs = Z.shape
     Zpart = Z[:,0:2]
     Zd = Z[:,2].reshape(Zs[0], 1)
@@ -1007,27 +1043,41 @@
 
 def to_mlab_linkage(Z):
     """
-    Z2 = to_mlab_linkage(Z)
+    Converts a linkage matrix ``Z`` generated by the linkage function
+    of this module to a MATLAB(TM) compatible one. The return linkage
+    matrix has the last column removed and the cluster indices are
+    converted to ``1..N`` indexing.
 
-    Converts a linkage matrix Z generated by the linkage function of this
-    module to one compatible with MATLAB(TM). Z2 is the same as Z with the
-    last column removed and the cluster indices converted to use
-    1..N indexing.
+    :Arguments:
+       - Z : ndarray
+           A linkage matrix generated by this library.
+
+    :Returns:
+       - ZM : ndarray
+           A linkage matrix compatible with MATLAB(TM)'s hierarchical
+           clustering functions.
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
 
     return np.hstack([Z[:,0:2] + 1, Z[:,2]])
 
 def is_monotonic(Z):
     """
-    is_monotonic(Z)
+    Returns ``True`` if the linkage passed is monotonic. The linkage
+    is monotonic if for every cluster :math:`$s$` and :math:`$t$`
+    joined, the distance between them is no less than the distance
+    between any previously joined clusters.
 
-      Returns True if the linkage Z is monotonic. The linkage is monotonic
-      if for every cluster s and t joined, the distance between them is
-      no less than the distance between any previously joined clusters.
+    :Arguments:
+        - Z : ndarray
+          The linkage matrix to check for monotonicity.
+
+    :Returns:
+        - b : bool
+          A boolean indicating whether the linkage is monotonic.
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
 
     # We expect the i'th value to be greater than its successor.
@@ -1035,14 +1085,33 @@
 
 def is_valid_im(R, warning=False, throw=False, name=None):
     """
-    is_valid_im(R)
 
-      Returns True if the inconsistency matrix passed is valid. It must
-      be a n by 4 numpy array of doubles. The standard deviations R[:,1]
-      must be nonnegative. The link counts R[:,2] must be positive and
-      no greater than n-1.
+    Returns True if the inconsistency matrix passed is valid. It must
+    be a :math:`$n$` by 4 numpy array of doubles. The standard
+    deviations ``R[:,1]`` must be nonnegative. The link counts
+    ``R[:,2]`` must be positive and no greater than :math:`$n-1$`.
+
+    :Arguments:
+         - R : ndarray
+           The inconsistency matrix to check for validity.
+
+         - warning : bool
+           When ``True``, issues a Python warning if the linkage
+           matrix passed is invalid.
+
+         - throw : bool
+           When ``True``, throws a Python exception if the linkage
+           matrix passed is invalid.
+
+         - name : string
+           This string refers to the variable name of the invalid
+           linkage matrix.
+
+    :Returns:
+         - b : bool
+           True iff the inconsistency matrix is valid.
     """
-    R = np.asarray(R)
+    R = np.asarray(R, order='c')
     valid = True
     try:
         if type(R) != np.ndarray:
@@ -1080,29 +1149,35 @@
 
 def is_valid_linkage(Z, warning=False, throw=False, name=None):
     """
-    is_valid_linkage(Z, t)
+    Checks the validity of a linkage matrix. A linkage matrix is valid
+    if it is a two dimensional nd-array (type double) with :math:`$n$`
+    rows and 4 columns.  The first two columns must contain indices
+    between 0 and :math:`$2n-1$`. For a given row ``i``,
+    :math:`$0 \leq \mathtt{Z[i,0]} \leq i+n-1$` and
+    :math:`$0 \leq Z[i,1] \leq i+n-1$` (i.e.  a cluster
+    cannot join another cluster unless the cluster being joined has
+    been generated.)
 
-      Returns True if Z is a valid linkage matrix. The variable must
-      be a 2-dimensional double numpy array with n rows and 4 columns.
-      The first two columns must contain indices between 0 and 2n-1. For a
-      given row i, 0 <= Z[i,0] <= i+n-1 and 0 <= Z[i,1] <= i+n-1 (i.e.
-      a cluster cannot join another cluster unless the cluster being joined
-      has been generated.)
+    :Arguments:
 
-    is_valid_linkage(..., warning=True, name='V')
+         - warning : bool
+           When ``True``, issues a Python warning if the linkage
+           matrix passed is invalid.
 
-      Invokes a warning if the variable passed is not a valid linkage. The message
-      explains why the distance matrix is not valid. 'name' is used when referencing
-      the offending variable.
+         - throw : bool
+           When ``True``, throws a Python exception if the linkage
+           matrix passed is invalid.
 
-    is_valid_linkage(..., throw=True, name='V')
+         - name : string
+           This string refers to the variable name of the invalid
+           linkage matrix.
 
-      Throws an exception if the variable passed is not a valid linkage. The message
-      explains why variable is not valid. 'name' is used when referencing the offending
-      variable.
+    :Returns:
+         - b : bool
+            True iff the inconsistency matrix is valid.
 
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
     valid = True
     try:
         if type(Z) != np.ndarray:
@@ -1143,25 +1218,47 @@
 
 def numobs_linkage(Z):
     """
-    Returns the number of original observations that correspond to a
-    linkage matrix Z.
+    Returns the number of original observations of the linkage matrix
+    passed.
+
+    :Arguments:
+        - Z : ndarray
+            The linkage matrix on which to perform the operation.
+
+    :Returns:
+        - n : int
+            The number of original observations in the linkage.
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
     return (Z.shape[0] + 1)
 
 def Z_y_correspond(Z, Y):
     """
-    yesno = Z_y_correspond(Z, Y)
+    Checks if a linkage matrix Z and condensed distance matrix
+    Y could possibly correspond to one another.
 
-      Returns True if a linkage matrix Z and condensed distance matrix
-      Y could possibly correspond to one another. They must have the same
-      number of original observations. This function is useful as a sanity
-      check in algorithms that make extensive use of linkage and distance
-      matrices that must correspond to the same set of original observations.
+    They must have the same number of original observations for
+    the check to succeed.
+
+    This function is useful as a sanity check in algorithms that make
+    extensive use of linkage and distance matrices that must
+    correspond to the same set of original observations.
+
+    :Arguments:
+        - Z : ndarray
+            The linkage matrix to check for correspondance.
+
+        - Y : ndarray
+            The condensed distance matrix to check for correspondance.
+
+    :Returns:
+        - b : bool
+            A boolean indicating whether the linkage matrix and distance
+            matrix could possibly correspond to one another.
     """
-    Z = np.asarray(Z)
-    Y = np.asarray(Y)
+    Z = np.asarray(Z, order='c')
+    Y = np.asarray(Y, order='c')
     return numobs_y(Y) == numobs_linkage(Z)
 
 def fcluster(Z, t, criterion='inconsistent', depth=2, R=None, monocrit=None):
@@ -1221,7 +1318,7 @@
           cluster(Z, t=3, criterion='maxclust_monocrit', monocrit=MI)
 
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
 
     n = Z.shape[0] + 1
@@ -1235,7 +1332,7 @@
         if R is None:
             R = inconsistent(Z, depth)
         else:
-            R = np.asarray(R)
+            R = np.asarray(R, order='c')
             is_valid_im(R, throw=True, name='R')
             # Since the C code does not support striding using strides.
             # The dimensions are used instead.
@@ -1305,7 +1402,7 @@
 
     This function is similar to MATLAB(TM) clusterdata function.
     """
-    X = np.asarray(X)
+    X = np.asarray(X, order='c')
 
     if type(X) != np.ndarray or len(X.shape) != 2:
         raise TypeError('The observation matrix X must be an n by m numpy array.')
@@ -1315,7 +1412,7 @@
     if R is None:
         R = inconsistent(Z, d=depth)
     else:
-        R = np.asarray(R)
+        R = np.asarray(R, order='c')
     T = fcluster(Z, criterion=criterion, depth=depth, R=R, t=t)
     return T
 
@@ -1326,7 +1423,7 @@
       Returns a list of leaf node ids as they appear in the tree from
       left to right. Z is a linkage matrix.
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
     n = Z.shape[0] + 1
     ML = np.zeros((n,), dtype=np.int)
@@ -1765,7 +1862,7 @@
     #         or results in a crossing, an exception will be thrown. Passing
     #         None orders leaf nodes based on the order they appear in the
     #         pre-order traversal.
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
 
     is_valid_linkage(Z, throw=True, name='Z')
     Zs = Z.shape
@@ -2129,8 +2226,8 @@
       Returns True iff two different cluster assignments T1 and T2 are
       equivalent. T1 and T2 must be arrays of the same size.
     """
-    T1 = np.asarray(T1)
-    T2 = np.asarray(T2)
+    T1 = np.asarray(T1, order='c')
+    T2 = np.asarray(T2, order='c')
 
     if type(T1) != np.ndarray:
         raise TypeError('T1 must be a numpy array.')
@@ -2169,7 +2266,7 @@
       Note that when Z[:,2] is monotonic, Z[:,2] and MD should not differ.
       See linkage for more information on this issue.
     """
-    Z = np.asarray(Z)
+    Z = np.asarray(Z, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
 
     n = Z.shape[0] + 1
@@ -2187,8 +2284,8 @@
       inconsistency matrix. MI is a monotonic (n-1)-sized numpy array of
       doubles.
     """
-    Z = np.asarray(Z)
-    R = np.asarray(R)
+    Z = np.asarray(Z, order='c')
+    R = np.asarray(R, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
     is_valid_im(R, throw=True, name='R')
 
@@ -2207,8 +2304,8 @@
     is the maximum over R[Q(j)-n, i] where Q(j) the set of all node ids
     corresponding to nodes below and including j.
     """
-    Z = np.asarray(Z)
-    R = np.asarray(R)
+    Z = np.asarray(Z, order='c')
+    R = np.asarray(R, order='c')
     is_valid_linkage(Z, throw=True, name='Z')
     is_valid_im(R, throw=True, name='R')
     if type(i) is not types.IntType:
@@ -2244,8 +2341,8 @@
     i < n, i corresponds to an original observation, otherwise it
     corresponds to a non-singleton cluster.
     """
-    Z = np.asarray(Z)
-    T = np.asarray(T)
+    Z = np.asarray(Z, order='c')
+    T = np.asarray(T, order='c')
     if type(T) != np.ndarray or T.dtype != np.int:
         raise TypeError('T must be a one-dimensional numpy array of integers.')
     is_valid_linkage(Z, throw=True, name='Z')

Modified: branches/refactor_fft/scipy/cluster/src/distance.c
===================================================================
--- branches/refactor_fft/scipy/cluster/src/distance.c	2008-10-22 13:52:41 UTC (rev 4827)
+++ branches/refactor_fft/scipy/cluster/src/distance.c	2008-10-23 12:30:20 UTC (rev 4828)
@@ -294,6 +294,16 @@
   return pow(s, 1.0 / p);
 }
 
+double weighted_minkowski_distance(const double *u, const double *v, int n, double p, const double *w) {
+  int i = 0;
+  double s = 0.0, d;
+  for (i = 0; i < n; i++) {
+    d = fabs(u[i] - v[i]) * w[i];
+    s = s + pow(d, p);
+  }
+  return pow(s, 1.0 / p);
+}
+
 void compute_mean_vector(double *res, const double *X, int m, int n) {
   int i, j;
   const double *v;
@@ -489,6 +499,19 @@
   }
 }
 
+void pdist_weighted_minkowski(const double *X, double *dm, int m, int n, double p, const double *w) {
+  int i, j;
+  const double *u, *v;
+  double *it = dm;
+  for (i = 0; i < m; i++) {
+    for (j = i + 1; j < m; j++, it++) {
+      u = X + (n * i);
+      v = X + (n * j);
+      *it = weighted_minkowski_distance(u, v, n, p, w);
+    }
+  }
+}
+
 void pdist_yule_bool(const char *X, double *dm, int m, int n) {
   int i, j;
   const char *u, *v;
@@ -700,7 +723,7 @@
 }
 
 void cdist_hamming_bool(const char *XA,
-			const char *XB, const char *X, double *dm, int mA, int mB, int n) {
+			const char *XB, double *dm, int mA, int mB, int n) {
   int i, j;
   const char *u, *v;
   double *it = dm;
@@ -813,6 +836,19 @@
   }
 }
 
+void cdist_weighted_minkowski(const double *XA, const double *XB, double *dm, int mA, int mB, int n, double p, const double *w) {
+  int i, j;
+  const double *u, *v;
+  double *it = dm;
+  for (i = 0; i < mA; i++) {
+    for (j = 0; j < mB; j++, it++) {
+      u = XA + (n * i);
+      v = XB + (n * j);
+      *it = weighted_minkowski_distance(u, v, n, p, w);
+    }
+  }
+}
+
 void cdist_yule_bool(const char *XA, const char *XB, double *dm, int mA, int mB, int n) {
   int i, j;
   const char *u, *v;

Modified: branches/refactor_fft/scipy/cluster/src/distance.h
===================================================================
--- branches/refactor_fft/scipy/cluster/src/distance.h	2008-10-22 13:52:41 UTC (rev 4827)
+++ branches/refactor_fft/scipy/cluster/src/distance.h	2008-10-23 12:30:20 UTC (rev 4828)
@@ -55,6 +55,7 @@
 void pdist_jaccard_bool(const char *X, double *dm, int m, int n);
 void pdist_kulsinski_bool(const char *X, double *dm, int m, int n);
 void pdist_minkowski(const double *X, double *dm, int m, int n, double p);
+void pdist_weighted_minkowski(const double *X, double *dm, int m, int n, double p, const double *w);
 void pdist_yule_bool(const char *X, double *dm, int m, int n);
 void pdist_matching_bool(const char *X, double *dm, int m, int n);
 void pdist_dice_bool(const char *X, double *dm, int m, int n);
@@ -74,7 +75,7 @@
 void cdist_hamming(const double *XA,
 		   const double *XB, double *dm, int mA, int mB, int n);
 void cdist_hamming_bool(const char *XA,
-			const char *XB, const char *X, double *dm,
+			const char *XB, double *dm,
 			int mA, int mB, int n);
 void cdist_jaccard(const double *XA,
 		   const double *XB, double *dm, int mA, int mB, int n);
@@ -93,6 +94,8 @@
 		      int mA, int mB, int n);
 void cdist_minkowski(const double *XA, const double *XB, double *dm,
 		     int mA, int mB, int n, double p);
+void cdist_weighted_minkowski(const double *XA, const double *XB, double *dm,
+			      int mA, int mB, int n, double p, const double *w);
 void cdist_yule_bool(const char *XA, const char *XB, double *dm,
 		     int mA, int mB, int n);
 void cdist_matching_bool(const char *XA, const char *XB, double *dm,

Modified: branches/refactor_fft/scipy/cluster/src/distance_wrap.c
===================================================================
--- branches/refactor_fft/scipy/cluster/src/distance_wrap.c	2008-10-22 13:52:41 UTC (rev 4827)
+++ branches/refactor_fft/scipy/cluster/src/distance_wrap.c	2008-10-23 12:30:20 UTC (rev 4828)
@@ -40,6 +40,530 @@
 #include <numpy/arrayobject.h>
 #include <stdio.h>
 
+extern PyObject *cdist_euclidean_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_euclidean(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_canberra_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_canberra(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_bray_curtis_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_bray_curtis(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+
+extern PyObject *cdist_mahalanobis_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *covinv_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  const double *covinv;
+  if (!PyArg_ParseTuple(args, "O!O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &covinv_,
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    covinv = (const double*)covinv_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_mahalanobis(XA, XB, covinv, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+
+extern PyObject *cdist_chebyshev_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_chebyshev(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+
+extern PyObject *cdist_cosine_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_, *normsA_, *normsB_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB, *normsA, *normsB;
+  if (!PyArg_ParseTuple(args, "O!O!O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_,
+			&PyArray_Type, &normsA_,
+			&PyArray_Type, &normsB_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    normsA = (const double*)normsA_->data;
+    normsB = (const double*)normsB_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_cosine(XA, XB, dm, mA, mB, n, normsA, normsB);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_seuclidean_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_, *var_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB, *var;
+  if (!PyArg_ParseTuple(args, "O!O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &var_,
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    var = (double*)var_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_seuclidean(XA, XB, var, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_city_block_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_city_block(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_hamming_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_hamming(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_hamming_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_hamming_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_jaccard_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_jaccard(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_jaccard_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_jaccard_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_minkowski_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB;
+  double p;
+  if (!PyArg_ParseTuple(args, "O!O!O!d",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_,
+			&p)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+    cdist_minkowski(XA, XB, dm, mA, mB, n, p);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_weighted_minkowski_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_, *w_;
+  int mA, mB, n;
+  double *dm;
+  const double *XA, *XB, *w;
+  double p;
+  if (!PyArg_ParseTuple(args, "O!O!O!dO!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_,
+			&p,
+			&PyArray_Type, &w_)) {
+    return 0;
+  }
+  else {
+    XA = (const double*)XA_->data;
+    XB = (const double*)XB_->data;
+    w = (const double*)w_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+    cdist_weighted_minkowski(XA, XB, dm, mA, mB, n, p, w);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+extern PyObject *cdist_yule_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_yule_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("");
+}
+
+extern PyObject *cdist_matching_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_matching_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("");
+}
+
+extern PyObject *cdist_dice_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_dice_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("");
+}
+
+extern PyObject *cdist_rogerstanimoto_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_rogerstanimoto_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("");
+}
+
+extern PyObject *cdist_russellrao_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_russellrao_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("");
+}
+
+extern PyObject *cdist_kulsinski_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_kulsinski_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("");
+}
+
+extern PyObject *cdist_sokalmichener_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_sokalmichener_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("");
+}
+
+extern PyObject *cdist_sokalsneath_bool_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *XA_, *XB_, *dm_;
+  int mA, mB, n;
+  double *dm;
+  const char *XA, *XB;
+  if (!PyArg_ParseTuple(args, "O!O!O!",
+			&PyArray_Type, &XA_, &PyArray_Type, &XB_, 
+			&PyArray_Type, &dm_)) {
+    return 0;
+  }
+  else {
+    XA = (const char*)XA_->data;
+    XB = (const char*)XB_->data;
+    dm = (double*)dm_->data;
+    mA = XA_->dimensions[0];
+    mB = XB_->dimensions[0];
+    n = XA_->dimensions[1];
+
+    cdist_sokalsneath_bool(XA, XB, dm, mA, mB, n);
+  }
+  return Py_BuildValue("");
+}
+
+/***************************** pdist ***/
+
 extern PyObject *pdist_euclidean_wrap(PyObject *self, PyObject *args) {
   PyArrayObject *X_, *dm_;
   int m, n;
@@ -324,7 +848,31 @@
   return Py_BuildValue("d", 0.0);
 }
 
+extern PyObject *pdist_weighted_minkowski_wrap(PyObject *self, PyObject *args) {
+  PyArrayObject *X_, *dm_, *w_;
+  int m, n;
+  double *dm, *X, *w;
+  double p;
+  if (!PyArg_ParseTuple(args, "O!O!dO!",
+			&PyArray_Type, &X_,
+			&PyArray_Type, &dm_,
+			&p,
+			&PyArray_Type, &w_)) {
+    return 0;
+  }
+  else {
+    X = (double*)X_->data;
+    dm = (double*)dm_->data;
+    w = (const double*)w_->data;
+    m = X_->dimensions[0];
+    n = X_->dimensions[1];
 
+    pdist_weighted_minkowski(X, dm, m, n, p, w);
+  }
+  return Py_BuildValue("d", 0.0);
+}
+
+
 extern PyObject *pdist_yule_bool_wrap(PyObject *self, PyObject *args) {
   PyArrayObject *X_, *dm_;
   int m, n;
@@ -533,6 +1081,28 @@
 
 
 static PyMethodDef _distanceWrapMethods[] = {
+  {"cdist_bray_curtis_wrap", cdist_bray_curtis_wrap, METH_VARARGS},
+  {"cdist_canberra_wrap", cdist_canberra_wrap, METH_VARARGS},
+  {"cdist_chebyshev_wrap", cdist_chebyshev_wrap, METH_VARARGS},
+  {"cdist_city_block_wrap", cdist_city_block_wrap, METH_VARARGS},
+  {"cdist_cosine_wrap", cdist_cosine_wrap, METH_VARARGS},
+  {"cdist_dice_bool_wrap", cdist_dice_bool_wrap, METH_VARARGS},
+  {"cdist_euclidean_wrap", cdist_euclidean_wrap, METH_VARARGS},
+  {"cdist_hamming_wrap", cdist_hamming_wrap, METH_VARARGS},
+  {"cdist_hamming_bool_wrap", cdist_hamming_bool_wrap, METH_VARARGS},
+  {"cdist_jaccard_wrap", cdist_jaccard_wrap, METH_VARARGS},
+  {"cdist_jaccard_bool_wrap", cdist_jaccard_bool_wrap, METH_VARARGS},
+  {"cdist_kulsinski_bool_wrap", cdist_kulsinski_bool_wrap, METH_VARARGS},
+  {"cdist_mahalanobis_wrap", cdist_mahalanobis_wrap, METH_VARARGS},
+  {"cdist_matching_bool_wrap", cdist_matching_bool_wrap, METH_VARARGS},
+  {"cdist_minkowski_wrap", cdist_minkowski_wrap, METH_VARARGS},
+  {"cdist_weighted_minkowski_wrap", cdist_weighted_minkowski_wrap, METH_VARARGS},
+  {"cdist_rogerstanimoto_bool_wrap", cdist_rogerstanimoto_bool_wrap, METH_VARARGS},
+  {"cdist_russellrao_bool_wrap", cdist_russellrao_bool_wrap, METH_VARARGS},
+  {"cdist_seuclidean_wrap", cdist_seuclidean_wrap, METH_VARARGS},
+  {"cdist_sokalmichener_bool_wrap", cdist_sokalmichener_bool_wrap, METH_VARARGS},
+  {"cdist_sokalsneath_bool_wrap", cdist_sokalsneath_bool_wrap, METH_VARARGS},
+  {"cdist_yule_bool_wrap", cdist_yule_bool_wrap, METH_VARARGS},
   {"pdist_bray_curtis_wrap", pdist_bray_curtis_wrap, METH_VARARGS},
   {"pdist_canberra_wrap", pdist_canberra_wrap, METH_VARARGS},
   {"pdist_chebyshev_wrap", pdist_chebyshev_wrap, METH_VARARGS},
@@ -548,6 +1118,7 @@
   {"pdist_mahalanobis_wrap", pdist_mahalanobis_wrap, METH_VARARGS},
   {"pdist_matching_bool_wrap", pdist_matching_bool_wrap, METH_VARARGS},
   {"pdist_minkowski_wrap", pdist_minkowski_wrap, METH_VARARGS},
+  {"pdist_weighted_minkowski_wrap", pdist_weighted_minkowski_wrap, METH_VARARGS},
   {"pdist_rogerstanimoto_bool_wrap", pdist_rogerstanimoto_bool_wrap, METH_VARARGS},
   {"pdist_russellrao_bool_wrap", pdist_russellrao_bool_wrap, METH_VARARGS},
   {"pdist_seuclidean_wrap", pdist_seuclidean_wrap, METH_VARARGS},

Copied: branches/refactor_fft/scipy/cluster/tests/cdist-X1.txt (from rev 4827, trunk/scipy/cluster/tests/cdist-X1.txt)

Copied: branches/refactor_fft/scipy/cluster/tests/cdist-X2.txt (from rev 4827, trunk/scipy/cluster/tests/cdist-X2.txt)

Modified: branches/refactor_fft/scipy/cluster/tests/test_distance.py
===================================================================
--- branches/refactor_fft/scipy/cluster/tests/test_distance.py	2008-10-22 13:52:41 UTC (rev 4827)
+++ branches/refactor_fft/scipy/cluster/tests/test_distance.py	2008-10-23 12:30:20 UTC (rev 4828)
@@ -34,17 +34,16 @@
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-import sys
 import os.path
 
 import numpy as np
 from numpy.testing import *
-from scipy.cluster.hierarchy import linkage, from_mlab_linkage, numobs_linkage
-from scipy.cluster.distance import squareform, pdist, matching, jaccard, dice, sokalsneath, rogerstanimoto, russellrao, yule, numobs_dm, numobs_y
+from scipy.cluster.distance import squareform, pdist, cdist, matching, \
+    jaccard, dice, sokalsneath, rogerstanimoto, russellrao, yule
 
-#from scipy.cluster.hierarchy import pdist, euclidean
-
 _filenames = ["iris.txt",
+              "cdist-X1.txt",
+              "cdist-X2.txt",
               "pdist-hamming-ml.txt",
               "pdist-boolean-inp.txt",
               "pdist-jaccard-ml.txt",
@@ -97,6 +96,365 @@
 #print np.abs(Y_test2 - Y_right).max()
 #print np.abs(Y_test1 - Y_right).max()
 
+class TestCdist(TestCase):
+    """
+    Test suite for the pdist function.
+    """
+
+    def test_cdist_euclidean_random(self):
+        "Tests cdist(X, 'euclidean') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'euclidean')
+        Y2 = cdist(X1, X2, 'test_euclidean')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_sqeuclidean_random(self):
+        "Tests cdist(X, 'sqeuclidean') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'sqeuclidean')
+        Y2 = cdist(X1, X2, 'test_sqeuclidean')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_cityblock_random(self):
+        "Tests cdist(X, 'sqeuclidean') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'cityblock')
+        Y2 = cdist(X1, X2, 'test_cityblock')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_hamming_double_random(self):
+        "Tests cdist(X, 'hamming') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'hamming')
+        Y2 = cdist(X1, X2, 'test_hamming')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_hamming_bool_random(self):
+        "Tests cdist(X, 'hamming') on random boolean data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'hamming')
+        Y2 = cdist(X1, X2, 'test_hamming')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_jaccard_double_random(self):
+        "Tests cdist(X, 'jaccard') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'jaccard')
+        Y2 = cdist(X1, X2, 'test_jaccard')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_jaccard_bool_random(self):
+        "Tests cdist(X, 'jaccard') on random boolean data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'jaccard')
+        Y2 = cdist(X1, X2, 'test_jaccard')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_chebychev_random(self):
+        "Tests cdist(X, 'chebychev') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'chebychev')
+        Y2 = cdist(X1, X2, 'test_chebychev')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_minkowski_random_p3d8(self):
+        "Tests cdist(X, 'minkowski') on random data. (p=3.8)"
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'minkowski', p=3.8)
+        Y2 = cdist(X1, X2, 'test_minkowski', p=3.8)
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_minkowski_random_p4d6(self):
+        "Tests cdist(X, 'minkowski') on random data. (p=4.6)"
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'minkowski', p=4.6)
+        Y2 = cdist(X1, X2, 'test_minkowski', p=4.6)
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_minkowski_random_p1d23(self):
+        "Tests cdist(X, 'minkowski') on random data. (p=1.23)"
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'minkowski', p=1.23)
+        Y2 = cdist(X1, X2, 'test_minkowski', p=1.23)
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+
+    def test_cdist_wminkowski_random_p3d8(self):
+        "Tests cdist(X, 'wminkowski') on random data. (p=3.8)"
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        w = 1.0 / X1.std(axis=0)
+        Y1 = cdist(X1, X2, 'wminkowski', p=3.8, w=w)
+        Y2 = cdist(X1, X2, 'test_wminkowski', p=3.8, w=w)
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_wminkowski_random_p4d6(self):
+        "Tests cdist(X, 'wminkowski') on random data. (p=4.6)"
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        w = 1.0 / X1.std(axis=0)
+        Y1 = cdist(X1, X2, 'wminkowski', p=4.6, w=w)
+        Y2 = cdist(X1, X2, 'test_wminkowski', p=4.6, w=w)
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_wminkowski_random_p1d23(self):
+        "Tests cdist(X, 'wminkowski') on random data. (p=1.23)"
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        w = 1.0 / X1.std(axis=0)
+        Y1 = cdist(X1, X2, 'wminkowski', p=1.23, w=w)
+        Y2 = cdist(X1, X2, 'test_wminkowski', p=1.23, w=w)
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+
+    def test_cdist_seuclidean_random(self):
+        "Tests cdist(X, 'seuclidean') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'seuclidean')
+        Y2 = cdist(X1, X2, 'test_seuclidean')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_sqeuclidean_random(self):
+        "Tests cdist(X, 'sqeuclidean') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'sqeuclidean')
+        Y2 = cdist(X1, X2, 'test_sqeuclidean')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_cosine_random(self):
+        "Tests cdist(X, 'cosine') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'cosine')
+        Y2 = cdist(X1, X2, 'test_cosine')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_correlation_random(self):
+        "Tests cdist(X, 'correlation') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'correlation')
+        Y2 = cdist(X1, X2, 'test_correlation')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_mahalanobis_random(self):
+        "Tests cdist(X, 'mahalanobis') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1']
+        X2 = eo['cdist-X2']
+        Y1 = cdist(X1, X2, 'mahalanobis')
+        Y2 = cdist(X1, X2, 'test_mahalanobis')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_canberra_random(self):
+        "Tests cdist(X, 'canberra') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'canberra')
+        Y2 = cdist(X1, X2, 'test_canberra')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_braycurtis_random(self):
+        "Tests cdist(X, 'braycurtis') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'braycurtis')
+        Y2 = cdist(X1, X2, 'test_braycurtis')
+        if verbose > 2:
+            print Y1, Y2
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_yule_random(self):
+        "Tests cdist(X, 'yule') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'yule')
+        Y2 = cdist(X1, X2, 'test_yule')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_matching_random(self):
+        "Tests cdist(X, 'matching') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'matching')
+        Y2 = cdist(X1, X2, 'test_matching')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_kulsinski_random(self):
+        "Tests cdist(X, 'kulsinski') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'kulsinski')
+        Y2 = cdist(X1, X2, 'test_kulsinski')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_dice_random(self):
+        "Tests cdist(X, 'dice') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'dice')
+        Y2 = cdist(X1, X2, 'test_dice')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_rogerstanimoto_random(self):
+        "Tests cdist(X, 'rogerstanimoto') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] < 0.5
+        Y1 = cdist(X1, X2, 'rogerstanimoto')
+        Y2 = cdist(X1, X2, 'test_rogerstanimoto')
+        if verbose > 2:
+            print (Y1-Y2).max()
+        self.failUnless(within_tol(Y1, Y2, eps))
+
+    def test_cdist_russellrao_random(self):
+        "Tests cdist(X, 'russellrao') on random data."
+        eps = 1e-07
+        # Get the data: the input matrix and the right output.
+        X1 = eo['cdist-X1'] < 0.5
+        X2 = eo['cdist-X2'] <