MAINT: move npy_is_aligned to common.h

also make it and some other alignment operators a bit faster by using
unsigned integers and bitwise and if possible.
Make use of npy_is_aligned in _IsAligned too.
ENH: add NPY_LIKELY and NPY_UNLIKELY macros for branching hints

Use it for npy_is_aligned expecting alignments of the power of two.
Cuts down the time spent in _IsAligned by the testsuite relative
to the rest of multiarray.so from 0.6% to 0.4%
BUG: Fix PyType_FastSubclass() check for numpy.int_

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
BUG: Document that numpy.int_ doesn't inherit from int on Py3k

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
TST: Add regression test to check numpy.int_ inheritance on Py2/Py3

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
BUG: Fix test_operand_flags test.

The test tests an inner loop in operand_flag_tests.c.src that expects
a long type, but it is tested using 'i8'. This fails when long is not
'i8'.

Closes #3363.
Merge pull request #3526 from zyv/fix_int_inheritance

BUG: Fix PyType_FastSubclass() check for numpy.int_ and Py3k inheritance
Merge pull request #3594 from juliantaylor/is_aligned_maint

MAINT: move npy_is_aligned to common.h
DOC: update example of histogram2d to doctest format.
DOC: fix some minor issues with histogram2d docstring formatting.
Merge branch 'pr/3591' into master.

See https://github.com/numpy/numpy/pull/3591
Merge pull request #3599 from charris/fix-operand-flags-test

BUG: Fix test_operand_flags test.
BUG: Fix variable declaration after statement.

Some declarations that are not at the beginning of a block have slipped
into the code. This breaks compilation on Python3.4a1. The Numpy coding
standard also disallows that construct.

Closes #3598.
ENH: add quickselect algorithm and expose it via partition

A partition sorts the kth element into its sorted order and moves all
smaller elements before the kth element and all equal or greater
elements behind it.
The ordering of all elements in the partitions is undefined.

It is implemented via the introselection algorithm which has worst case
linear complexity compared to a full sort that has linearithmic
complexity.
The introselect algorithm uses a quickselect with median of three pivot
and falls back to a quickselect with median of median of five pivot if
no sufficient progress is made.

The pivots used during the search for the wanted kth element can
optionally be stored and reused for further partitionings of the array.
This is used by the python interface if an array of kth is provided to
the partitions function. This improves the performance of median and
which need to select two elements if the size of the array is even. A
percentile function interpolating between values also profits from this.

String selection is implemented in terms of quicksort which has the same
properties as a selection for now.
ENH: implement median in terms of partition

Partitioning is sufficient to obtain the median and is much faster.
In the case of overwrite_input=True the resulting array will not be
fully sorted anymore.
Merge pull request #3600 from charris/fix-iso-c90-breakage

BUG: Fix variable declaration after statement.
Merge pull request #3360 from juliantaylor/selection-algo

 add quickselect algorithm and expose it via partition
BUG: Fix typo in core bento file.
DOC: Fix small typos in partition docstring.
Merge pull request #3606 from stefanv/selection_bento_fix

BUG: Fix typo in core bento file.