subscript: replace Fraction class with std::ratio

std::ratio implements the num/denum fraction as a type. It did not
implement the apply(AndAdd) functions that I needed it for. But those
were easy to implement as non-member functions as well.

Signed-off-by: Matthias Kretz <kretz@kde.org>
subscript: simplify type expression

and add a sanity check that it's the same type as expected.

Signed-off-by: Matthias Kretz <kretz@kde.org>
subscript: document the need for index instead of 0

Signed-off-by: Matthias Kretz <kretz@kde.org>
gathers: generalize gatherinterface.h (class name)

gatherinterface.h assumed the class was named Vector. But once we want
to use the header for simdarray as well we need an abstraction.
I could think of something nicer than a macro for doing so... :(

Signed-off-by: Matthias Kretz <kretz@kde.org>
simdarray: use gatherinterface.h

switched simdarray to use the common gatherinterface
declaration/definition. This enables:
a) the missing gather member function
b) generic abstractions in gatherinterface function definitions to carry
to simdarray as well

Signed-off-by: Matthias Kretz <kretz@kde.org>
gatherinterface: support std::vector as index argument

std::vector<T> can easily be mapped to T*, which is more generic to
support in gatherImplementation. Thus, have the gather functions do the
argument transformation transparently.

Signed-off-by: Matthias Kretz <kretz@kde.org>
gatherinterface: remove superfluous setZero call

The data member is expected to init to zero. Therefore, with the opening
brace of the constructor body the data is zero already.

Signed-off-by: Matthias Kretz <kretz@kde.org>
simdarray: remove unused/incorrect include

Signed-off-by: Matthias Kretz <kretz@kde.org>
subscript: back to efficient SIMD types for index

* SubscriptOperation used std::vector for the indexes as soon as it had
to apply the first scaling. This was inefficient - of course.
* Now, with simdarray working as it should it is easier to overload a
function convertIndexVector such that it returns the most suitable index
vector type, with an integer type that is at least int (thus index
vectors of short get promoted to int).

Signed-off-by: Matthias Kretz <kretz@kde.org>
gatherinterface: support SuccessiveEntries (for deinterleave)

Signed-off-by: Matthias Kretz <kretz@kde.org>
deinterleave test: convert to new TEST interface

Signed-off-by: Matthias Kretz <kretz@kde.org>
deinterleave test: drop one call indirection

use outer_product to create a typelist of ALL_VECTORS x {2,3,4,5,6,7,8}

Signed-off-by: Matthias Kretz <kretz@kde.org>
move index_sequence to its own header

This is such a useful helper class that I want to have it available to
the rest of Vc, too.

Signed-off-by: Matthias Kretz <kretz@kde.org>
operators: cleanup / rename / license header

* renamed Conditional to conditional_t (awaiting C++14)
* added BSD license header
* dropped the unnamed namespace

Signed-off-by: Matthias Kretz <kretz@kde.org>
operators: generalize MakeUnsignedInternal

work with any Vector<T>, not just the default

Signed-off-by: Matthias Kretz <kretz@kde.org>
(de)interleave: deprecate operator,

* the std::tie pattern is much nicer and now Vc just uses that
* cleaned up the implementation using variadic templates, which I didn't
have available when I started the code

Signed-off-by: Matthias Kretz <kretz@kde.org>
deinterleave: allow direct assignment to array

Any class that implements the tuple interface (std::tuple_size and
std::get) and is default-constructible can now be used as left-hand side
of an assignment from InterleavedMemoryWrapper.

Signed-off-by: Matthias Kretz <kretz@kde.org>
deinterleave test: fix rotate helper

the rotate helper for simdarray was just plain wrong - therefore the
test data (the indexes vector) was wrong and the test failed. While the
actual (de)interleave code was right...

Signed-off-by: Matthias Kretz <kretz@kde.org>
test interleaving scatter: generic implementation

Use index_sequences to generically implement the test. This gets rid of
the ugly macro hacks and also tests the assignment to std::array.

Signed-off-by: Matthias Kretz <kretz@kde.org>
InterleavedMemoryWrapper: use constexpr instead of enum

Signed-off-by: Matthias Kretz <kretz@kde.org>