added ordschur to base/linalg
fix #8531 (invalid range length)
Merge pull request #8533 from rfourquet/range-length

fix #8531 (invalid range length)
Merge pull request #8467 from axsk/ordschur

RFC: add ordschur function to base/linalg
Add ordschur to NEWS.md
restrict RandIntGen to generate random numbers in the interval [1,n]

This is based on @ivarne idea
(cf. https://github.com/JuliaLang/julia/pull/8255#issuecomment-54988949),
and continues commit 48f27bc in "avoiding duplicating the getindex logic".

The API to get a RandIntGen object is now to call randintgen(n).
This allows any Integer type to implement this function (e.g. BigInt).
Previously, a call like rand(big(1:10)) caused a stack overflow, it is now
a "no method matching" error, until randintgen(::BigInt) is implemented,
possibly using a new type similar to RandIntGen.
remove redundant rand! method
make rand work with AbstractArray instead of only with Range

This implements the generalization suggested by @ivarne
(https://github.com/JuliaLang/julia/issues/8257#issuecomment-54803220)
or by @lindahua
(https://github.com/JuliaLang/julia/issues/6003#issuecomment-46679039).
This change is very simple thanks to commit 48f27bc.
update the docs for rand/rand! and add some related tests
make RandIntGen stop handling "full range" random generation

The rand(T) function is already the normal way of generating random values
spanning "full range" of T. So let's make RandIntGen less powerful in the
name of orthogonality and simplicity.

Also tried to clarify a bit the `maxmultiple` comments.
factor out common code in rand(::RandIntGen) methods

And simplify method signatures: creation of RandIntGen instances
is controlled by `randintgen`, so the type constraints were useless.
remove rand!(::AbstractArray, ::AbstractArray) until #8246 is fixed
use only non-overflowing length in test/random.jl

After rebasing, the changes introduced by commit d31c447f are
incompatible with tests added in commit 4d1c1382. The problem is that
now any array-like r can be passed to rand (not only ranges), and for
a random element to be picked out of r, a random integer in the range
1:length(r) is generated, and hence `length(r)` has to be a valid
integer (e.g. length(typemin(Int):typemax(Int)) yields OverflowError()).
RandIntGen: improve error message

This is @ivarne idea (cf.
https://github.com/JuliaLang/julia/pull/8309#discussion_r18149653).
Move invariant checking in inner constructor, and emit a clearer error
message when this fail.