| 595 | void randomPermutationVector(PermutationVectorType& v, Index size); |
| 596 | template<typename PermutationVectorType> |
| 597 | void randomPermutationVector(PermutationVectorType& v, Index size) |
| 598 | { |
| 599 | typedef typename PermutationVectorType::Scalar Scalar; |
| 600 | v.resize(size); |
| 601 | for(Index i = 0; i < size; ++i) v(i) = Scalar(i); |
| 602 | if(size == 1) return; |
| 603 | for(Index n = 0; n < 3 * size; ++n) |
| 604 | { |
| 605 | Index i = internal::random<Index>(0, size-1); |
| 606 | Index j; |
| 607 | do j = internal::random<Index>(0, size-1); while(j==i); |
| 608 | std::swap(v(i), v(j)); |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | template<typename T> bool isNotNaN(const T& x) |
| 613 | { |
no test coverage detected