Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #114

Open
wants to merge 24 commits into
base: dev
Choose a base branch
from
Open

Dev #114

Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e8c0df8
warning --
ThomasRetornaz Feb 26, 2018
d70bbc3
fix TestData& operator=(const TestData& other) assignment operator
ThomasRetornaz Feb 26, 2018
8d91b7e
wip issue #107 add transform/reduce algorithm
ThomasRetornaz Feb 26, 2018
c679f81
issue #107 add fill,copy,copy_n algorithm
ThomasRetornaz Feb 26, 2018
4bc2c63
issue #107 gcc compil fix
Feb 28, 2018
22e5357
issue #107 add search max/min
ThomasRetornaz Mar 5, 2018
5c48da0
issue #107 add find,find_if,find_if_not
ThomasRetornaz Mar 5, 2018
ab3e92b
issue #107 fix gcc and release mode for find*
Mar 5, 2018
b0735f5
issue #107 add max_element and min_element
ThomasRetornaz Mar 6, 2018
0025a8f
issue #107 gcc compil/warning fix
Mar 6, 2018
ae48025
issue #107 add count, count_if
ThomasRetornaz Mar 7, 2018
c8d12f4
Merge branch 'dev' of https://github.com/ThomasRetornaz/libsimdpp int…
ThomasRetornaz Mar 7, 2018
dc33d00
issue #107 add all_of, any_of, none_of
Mar 7, 2018
d6a6bfa
issue #107 add replace,replace_if
Mar 8, 2018
f95aa05
issue #107 add equal and lexicographic_compare
Mar 10, 2018
b8b0b34
issue #107 add transform_reduce
Mar 11, 2018
179cc90
issue #107 ras
Mar 11, 2018
f57deb0
issue #107 visual compilation fix
ThomasRetornaz Mar 11, 2018
3d9fb98
issue #107
ThomasRetornaz Apr 9, 2018
d8b2eda
issue #107 gcc and c++11 only compil fix
Apr 9, 2018
9a3636a
issue #107
ThomasRetornaz Apr 11, 2018
6ae2a4a
issue #115 Proof of concept
ThomasRetornaz Jul 16, 2018
5977ee9
#issue 115 linux/gcc fix
Jul 20, 2018
e286519
* warn --
ThomasRetornaz Oct 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion doc/wiki/Main_Page.mwiki
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ various variants of matrix transpositions, interleaving loads/stores, optimized
compile-time shuffling instructions, etc. Each of these are implemented in the
most efficient manner for the target instruction set. Finally, it's possible
to fall back to native intrinsics when necessary, without compromising
maintanability.
maintainability.


The library sits somewhere in the middle between programming directly in
Expand Down Expand Up @@ -173,6 +173,32 @@ the compiler will generate.
{{ltt|misc/prefetch_read}}  {{ltt|misc/prefetch_write}}
</div>

'''[[Algorithm | STL like algorithm]]'''
<div class="mainpagediv">
{{ltt|algorithm/any_of}}<br/>
{{ltt|algorithm/all_of}}<br/>
{{ltt|algorithm/copy}}<br/>
{{ltt|algorithm/copy_n}}<br/>
{{ltt|algorithm/count}}<br/>
{{ltt|algorithm/count_if}}<br/>
{{ltt|algorithm/equal}}<br/>
{{ltt|algorithm/fill}}<br/>
{{ltt|algorithm/find}}<br/>
{{ltt|algorithm/find_if}}<br/>
{{ltt|algorithm/find_if_not}}<br/>
{{ltt|algorithm/lexicographical_compare}}<br/>
{{ltt|algorithm/max}}<br/>
{{ltt|algorithm/max_element}}<br/>
{{ltt|algorithm/min}}<br/>
{{ltt|algorithm/min_element}}<br/>
{{ltt|algorithm/none_of}}<br/>
{{ltt|algorithm/reduce}}<br/>
{{ltt|algorithm/replace}}<br/>
{{ltt|algorithm/replace_if}}<br/>
{{ltt|algorithm/transform}}<br/>
{{ltt|algorithm/transform_reduce}}<br/>
</div>

|- class="row rowbottom"
| colspan=4|
|}
27 changes: 27 additions & 0 deletions doc/wiki/algorithm/all_of.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{simdpp/title|all_of}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename UnaryPredicate>
bool all_of(T const* first, T const* last, UnaryPredicate pred);
}}

{{dcl end}}
{{misc/navbar}}

{{tt|all_of}} Checks if unary predicate p returns true for {{tt|all}} elements in the range {{tt|[first, last)}}.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to examine}}
{{par | pred | unary predicate
{{par end}}

===Return value===
{{tt|true}} if unary predicate returns {{tt|true}} for all elements in the range, {{tt|false}} otherwise. Returns {{tt|true}} if the range is empty.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc none_of}}
{{dsc inc | algorithm/dsc any_of}}
{{dsc end}}
27 changes: 27 additions & 0 deletions doc/wiki/algorithm/any_of.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{simdpp/title|any_of}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename UnaryPredicate>
bool any_of(T const* first, T const* last, UnaryPredicate pred);
}}

{{dcl end}}
{{misc/navbar}}

{{tt|all_of}} Checks if unary predicate p returns true for {{tt|at least one}} element in the range {{tt|[first, last)}}.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to examine}}
{{par | pred | unary predicate
{{par end}}

===Return value===
{{tt|true}} if unary predicate returns {{tt|true}} for at least one element in the range, {{tt|false}} otherwise. Returns {{tt|false}} if the range is empty.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc none_of}}
{{dsc inc | algorithm/dsc all_of}}
{{dsc end}}
27 changes: 27 additions & 0 deletions doc/wiki/algorithm/copy.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{simdpp/title|copy}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T>
T* copy(T const* first, T const* last, T* out)
}}

{{dcl end}}
{{misc/navbar}}

{{tt|copy}} Copies the elements in the range, defined by {{tt|[first, last)}}, to another range beginning at {{tt|out}}.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to copy}}
{{par | out | the beginning of the destination range.}}
{{par end}}

===Return value===
Output adress to the element in the destination range, one past the last element copied.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc fill}}
{{dsc inc | algorithm/dsc copy_n}}
{{dsc end}}
28 changes: 28 additions & 0 deletions doc/wiki/algorithm/copy_n.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{simdpp/title|copy}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename Size>
T* copy_n(T const* first, Size n, T* out)
}}

{{dcl end}}
{{misc/navbar}}

{{tt|copy_n}} Copies exactly {{tt|Size}} values from the range beginning at {{tt|first}} to the range beginning at {{tt|out}}, if {{tt|count>0}}. Does nothing otherwise.

===Parameters===
{{par begin}}
{{par | first | the beginning of the range of elements to copy from}}
{{par | Size | number of the elements to copy}}
{{par | out | the beginning of the destination range}}
{{par end}}

===Return value===
Output adress in the destination range, pointing past the last element copied if {{tt|Size>0}} or {{tt|out}} otherwise.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc fill}}
{{dsc inc | algorithm/dsc copy}}
{{dsc end}}
27 changes: 27 additions & 0 deletions doc/wiki/algorithm/count.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{simdpp/title|count}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename U>
typename std::iterator_traits<const T*>::difference_type
count(T const* first, T const* last, U val);
}}

{{dcl end}}
{{misc/navbar}}

{{tt|count}} counts the elements that are equal to value in the range defined by {{tt|[first, last)}}.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to examine}}
{{par | val | the value to search for}}
{{par end}}

===Return value===
number of elements satisfying the condition.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc count_if}}
{{dsc end}}
28 changes: 28 additions & 0 deletions doc/wiki/algorithm/count_if.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{simdpp/title|count_if}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename UnaryPredicate>
typename std::iterator_traits<const T*>::difference_type
count_if(T const* first, T const* last, UnaryPredicate pred);
}}

{{dcl end}}
{{misc/navbar}}

{{tt|count_if}} counts the elements that satisfied the predicate in the range defined by {{tt|[first, last)}}.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to examine}}
{{par | pred | unary predicate which returns {{tt|true}} for the required elements. }}
{{par end}}

===Return value===
number of elements satisfying the condition.


===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc count}}
{{dsc end}}
35 changes: 35 additions & 0 deletions doc/wiki/algorithm/equal.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{simdpp/title|equal}}
{{misc/navbar}}
{{dcl begin}}
{{dcl | num=1 |
template<typename T>
bool equal(const T* first1, const T* last1, const T* first2);
}}
{{dcl | num=2 |
template<typename T, typename BinaryPredicate>
bool equal(const T* first1, const T* last1, const T* first2,BinaryPredicate pred);

}}
{{dcl end}}
{{misc/navbar}}

{{tt|equal}} Returns {{c|true}} if the range {{tt|[first1,last1)}} is equal to the range {{tt|[first2, first2 + (last1 - first1))}} according to pred and {{c|false}} otherwise

@1@ Returns {{c|true}} if the range {{tt|[first1,last1)}} is equal to the range {{tt|[first2, first2 + (last1 - first1))}}, and {{c|false}} otherwise
@2@ The binary operation BinaryPredicate is applied to pairs of elements from two ranges: one defined by [first1, last1) and the other beginning at first2.

===Parameters===
{{par begin}}
{{par | first1, last1 | the first range of elements to examine}
{{par | first2 | the beginning of the second range of elements to examine}}
{{par | pred | binary predicate which returns ​true if the elements should be treated as equal.}}
{{par end}}

===Return value===
If the elements in the two ranges are equal, returns {{c|true}}.Otherwise returns {{c|false}}.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc find }}
{{dsc inc | algorithm/dsc lexicographic_compare }}
{{dsc end}}
26 changes: 26 additions & 0 deletions doc/wiki/algorithm/fill.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{simdpp/title|fill}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename U>
void fill(T* first, T* last, U value)
}}

{{dcl end}}
{{misc/navbar}}

{{tt|fill}} Assigns the given {{tt|value}} to the elements in the range {{tt|[first, last)}}.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to modify}}
{{par | value | the value to be assigned}}
{{par end}}

===Return value===
(none)

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc copy}}
{{dsc end}}
27 changes: 27 additions & 0 deletions doc/wiki/algorithm/find.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{simdpp/title|find}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename U>
T const* find(T const* first, T const* last, U val);
}}

{{dcl end}}
{{misc/navbar}}

{{tt|find}} Returns the first element in the range [first, last[ that equal val.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to examine}}
{{par | value | value to compare the elements to.}}
{{par end}}

===Return value===
Address to the first element satisfying the condition or last if no such element is found.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc find_if}}
{{dsc inc | algorithm/dsc find_if_not}}
{{dsc end}}
27 changes: 27 additions & 0 deletions doc/wiki/algorithm/find_if.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{simdpp/title|find_if}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename UnaryPredicate>
T const* find_if(T const* first, T const* last, UnaryPredicate pred);
}}

{{dcl end}}
{{misc/navbar}}

{{tt|find_if}} Returns the first element in the range [first, last[ that satisfies specific predicate.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to examine}}
{{par | pred | unary predicate which returns {{true}} for the required element.}}
{{par end}}

===Return value===
Address to the first element satisfying the condition or last if no such element is found.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc find}}
{{dsc inc | algorithm/dsc find_if_not}}
{{dsc end}}
27 changes: 27 additions & 0 deletions doc/wiki/algorithm/find_if_not.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{simdpp/title|find_if_not}}
{{misc/navbar}}
{{dcl begin}}
{{dcl |
template<typename T, typename UnaryPredicate>
T const* find_if_not(T const* first, T const* last, UnaryPredicate pred);
}}

{{dcl end}}
{{misc/navbar}}

{{tt|find_if}} Returns the first element in the range [first, last[ that {{not}} satisfies specific predicate.

===Parameters===
{{par begin}}
{{par | first, last | the range of elements to examine}}
{{par | pred | unary predicate which returns {{false}} for the required element.}}
{{par end}}

===Return value===
Address to the first element satisfying the condition or last if no such element is found.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc find}}
{{dsc inc | algorithm/dsc find_if}}
{{dsc end}}
34 changes: 34 additions & 0 deletions doc/wiki/algorithm/lexicographical_compare.mwiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{simdpp/title|lexicographical_compare}}
{{misc/navbar}}
{{dcl begin}}
{{dcl | num=1 |
template<typename T>
bool lexicographical_compare(const T* first1, const T* last1, const T* first2, const T* last2);
}}
{{dcl | num=2 |

template<typename T, typename BinarayPredicate>
bool lexicographical_compare(const T* first1, const T* last1, const T* first2, const T* last2,BinarayPredicate comp);
}}
{{dcl end}}
{{misc/navbar}}

{{tt|lexicographical_compare}} Checks if the first range {{c|[first1, last1)}} is lexicographically ''less'' than the second range {{c|[first2, last2)}}.

@1@ Elements are compared using {{tt|operator<}}.
@2@ Elements are compared using the given binary comparison function {{tt|comp}}.

===Parameters===
{{par begin}}
{{par | first1, last1 | the first range of elements to examine}}
{{par | first2, last2 | the second range of elements to examine}}
{{par | comp | comparaison operator}}
{{par end}}

===Return value===
{{c|true}} if the first range is lexicographically ''less'' than the second.

===See also===
{{dsc begin}}
{{dsc inc | algorithm/dsc equal }}
{{dsc end}}
Loading