Home
last modified time | relevance | path

Searched refs:N (Results 1 – 25 of 412) sorted by relevance

12345678910>>...17

/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.nth.element/
Dnth_element.pass.cpp22 test_one(unsigned N, unsigned M) in test_one() argument
24 assert(N != 0); in test_one()
25 assert(M < N); in test_one()
26 int* array = new int[N]; in test_one()
27 for (int i = 0; i < N; ++i) in test_one()
29 std::random_shuffle(array, array+N); in test_one()
30 std::nth_element(array, array+M, array+N); in test_one()
36 test(unsigned N) in test() argument
38 test_one(N, 0); in test()
39 test_one(N, 1); in test()
[all …]
Dnth_element_comp.pass.cpp35 test_one(unsigned N, unsigned M) in test_one() argument
37 assert(N != 0); in test_one()
38 assert(M < N); in test_one()
39 int* array = new int[N]; in test_one()
40 for (int i = 0; i < N; ++i) in test_one()
42 std::random_shuffle(array, array+N); in test_one()
43 std::nth_element(array, array+M, array+N, std::greater<int>()); in test_one()
44 assert(array[M] == N-M-1); in test_one()
49 test(unsigned N) in test() argument
51 test_one(N, 0); in test()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.sort/partial.sort/
Dpartial_sort.pass.cpp22 test_larger_sorts(unsigned N, unsigned M) in test_larger_sorts() argument
24 assert(N != 0); in test_larger_sorts()
25 int* array = new int[N]; in test_larger_sorts()
26 for (int i = 0; i < N; ++i) in test_larger_sorts()
28 std::random_shuffle(array, array+N); in test_larger_sorts()
29 std::partial_sort(array, array+M, array+N); in test_larger_sorts()
36 test_larger_sorts(unsigned N) in test_larger_sorts() argument
38 test_larger_sorts(N, 0); in test_larger_sorts()
39 test_larger_sorts(N, 1); in test_larger_sorts()
40 test_larger_sorts(N, 2); in test_larger_sorts()
[all …]
Dpartial_sort_comp.pass.cpp35 test_larger_sorts(unsigned N, unsigned M) in test_larger_sorts() argument
37 assert(N != 0); in test_larger_sorts()
38 int* array = new int[N]; in test_larger_sorts()
39 for (int i = 0; i < N; ++i) in test_larger_sorts()
41 std::random_shuffle(array, array+N); in test_larger_sorts()
42 std::partial_sort(array, array+M, array+N, std::greater<int>()); in test_larger_sorts()
44 assert(array[i] == N-i-1); in test_larger_sorts()
49 test_larger_sorts(unsigned N) in test_larger_sorts() argument
51 test_larger_sorts(N, 0); in test_larger_sorts()
52 test_larger_sorts(N, 1); in test_larger_sorts()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/utilities/template.bitset/bitset.members/
Dto_string.pass.cpp31 template <std::size_t N>
32 std::bitset<N>
35 std::bitset<N> v; in make_bitset()
36 for (std::size_t i = 0; i < N; ++i) in make_bitset()
41 template <std::size_t N>
45 std::bitset<N> v = make_bitset<N>(); in test_to_string()
48 for (std::size_t i = 0; i < N; ++i) in test_to_string()
50 assert(s[N - 1 - i] == '1'); in test_to_string()
52 assert(s[N - 1 - i] == '0'); in test_to_string()
56 for (std::size_t i = 0; i < N; ++i) in test_to_string()
[all …]
Dindex.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 std::bitset<N> v1 = make_bitset<N>(); in test_index_const()
32 if (N > 0) in test_index_const()
34 assert(v1[N/2] == v1.test(N/2)); in test_index_const()
35 typename std::bitset<N>::reference r = v1[N/2]; in test_index_const()
36 assert(r == v1.test(N/2)); in test_index_const()
[all …]
Dindex_const.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 const std::bitset<N> v1 = make_bitset<N>(); in test_index_const()
32 if (N > 0) in test_index_const()
34 assert(v1[N/2] == v1.test(N/2)); in test_index_const()
Dop_xor_eq.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 std::bitset<N> v1 = make_bitset<N>(); in test_op_xor_eq()
32 std::bitset<N> v2 = make_bitset<N>(); in test_op_xor_eq()
33 std::bitset<N> v3 = v1; in test_op_xor_eq()
35 for (std::size_t i = 0; i < N; ++i) in test_op_xor_eq()
Dop_and_eq.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 std::bitset<N> v1 = make_bitset<N>(); in test_op_and_eq()
32 std::bitset<N> v2 = make_bitset<N>(); in test_op_and_eq()
33 std::bitset<N> v3 = v1; in test_op_and_eq()
35 for (std::size_t i = 0; i < N; ++i) in test_op_and_eq()
Dop_or_eq.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 std::bitset<N> v1 = make_bitset<N>(); in test_op_or_eq()
32 std::bitset<N> v2 = make_bitset<N>(); in test_op_or_eq()
33 std::bitset<N> v3 = v1; in test_op_or_eq()
35 for (std::size_t i = 0; i < N; ++i) in test_op_or_eq()
Dright_shift_eq.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 for (std::size_t s = 0; s <= N+1; ++s) in test_right_shift()
33 std::bitset<N> v1 = make_bitset<N>(); in test_right_shift()
34 std::bitset<N> v2 = v1; in test_right_shift()
36 for (std::size_t i = 0; i < N; ++i) in test_right_shift()
37 if (i + s < N) in test_right_shift()
Dop_eq_eq.pass.cpp21 template <std::size_t N>
22 std::bitset<N>
25 std::bitset<N> v; in make_bitset()
26 for (std::size_t i = 0; i < N; ++i) in make_bitset()
31 template <std::size_t N>
34 const std::bitset<N> v1 = make_bitset<N>(); in test_equality()
35 std::bitset<N> v2 = v1; in test_equality()
37 if (N > 0) in test_equality()
39 v2[N/2].flip(); in test_equality()
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.sort/stable.sort/
Dstable_sort.pass.cpp75 test_larger_sorts(unsigned N, unsigned M) in test_larger_sorts() argument
77 assert(N != 0); in test_larger_sorts()
80 int* array = new int[N]; in test_larger_sorts()
82 for (int i = 0; i < N; ++i) in test_larger_sorts()
89 std::stable_sort(array, array+N); in test_larger_sorts()
90 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
92 std::random_shuffle(array, array+N); in test_larger_sorts()
93 std::stable_sort(array, array+N); in test_larger_sorts()
94 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
96 std::stable_sort(array, array+N); in test_larger_sorts()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.sort/sort/
Dsort.pass.cpp75 test_larger_sorts(unsigned N, unsigned M) in test_larger_sorts() argument
77 assert(N != 0); in test_larger_sorts()
80 int* array = new int[N]; in test_larger_sorts()
82 for (int i = 0; i < N; ++i) in test_larger_sorts()
89 std::sort(array, array+N); in test_larger_sorts()
90 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
92 std::random_shuffle(array, array+N); in test_larger_sorts()
93 std::sort(array, array+N); in test_larger_sorts()
94 assert(std::is_sorted(array, array+N)); in test_larger_sorts()
96 std::sort(array, array+N); in test_larger_sorts()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.sort/partial.sort.copy/
Dpartial_sort_copy_comp.pass.cpp30 test_larger_sorts(unsigned N, unsigned M) in test_larger_sorts() argument
32 int* input = new int[N]; in test_larger_sorts()
34 for (int i = 0; i < N; ++i) in test_larger_sorts()
36 std::random_shuffle(input, input+N); in test_larger_sorts()
37 int* r = std::partial_sort_copy(Iter(input), Iter(input+N), output, output+M, in test_larger_sorts()
39 int* e = output + std::min(N, M); in test_larger_sorts()
43 assert(*x == N-i-1); in test_larger_sorts()
50 test_larger_sorts(unsigned N) in test_larger_sorts() argument
52 test_larger_sorts<Iter>(N, 0); in test_larger_sorts()
53 test_larger_sorts<Iter>(N, 1); in test_larger_sorts()
[all …]
Dpartial_sort_copy.pass.cpp27 test_larger_sorts(unsigned N, unsigned M) in test_larger_sorts() argument
29 int* input = new int[N]; in test_larger_sorts()
31 for (int i = 0; i < N; ++i) in test_larger_sorts()
33 std::random_shuffle(input, input+N); in test_larger_sorts()
34 int* r = std::partial_sort_copy(Iter(input), Iter(input+N), output, output+M); in test_larger_sorts()
35 int* e = output + std::min(N, M); in test_larger_sorts()
46 test_larger_sorts(unsigned N) in test_larger_sorts() argument
48 test_larger_sorts<Iter>(N, 0); in test_larger_sorts()
49 test_larger_sorts<Iter>(N, 1); in test_larger_sorts()
50 test_larger_sorts<Iter>(N, 2); in test_larger_sorts()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.merge/
Dinplace_merge_comp.pass.cpp37 test_one(unsigned N, unsigned M) in test_one() argument
39 assert(M <= N); in test_one()
40 int* ia = new int[N]; in test_one()
41 for (unsigned i = 0; i < N; ++i) in test_one()
43 std::random_shuffle(ia, ia+N); in test_one()
45 std::sort(ia+M, ia+N, std::greater<int>()); in test_one()
46 std::inplace_merge(Iter(ia), Iter(ia+M), Iter(ia+N), std::greater<int>()); in test_one()
47 if(N > 0) in test_one()
49 assert(ia[0] == N-1); in test_one()
50 assert(ia[N-1] == 0); in test_one()
[all …]
Dinplace_merge.pass.cpp25 test_one(unsigned N, unsigned M) in test_one() argument
27 assert(M <= N); in test_one()
28 int* ia = new int[N]; in test_one()
29 for (unsigned i = 0; i < N; ++i) in test_one()
31 std::random_shuffle(ia, ia+N); in test_one()
33 std::sort(ia+M, ia+N); in test_one()
34 std::inplace_merge(Iter(ia), Iter(ia+M), Iter(ia+N)); in test_one()
35 if(N > 0) in test_one()
38 assert(ia[N-1] == N-1); in test_one()
39 assert(std::is_sorted(ia, ia+N)); in test_one()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/utilities/memory/ptr.align/
Dalign.pass.cpp20 const unsigned N = 20; in main() local
21 char buf[N]; in main()
24 std::size_t s = N; in main()
28 assert(s == N); in main()
31 s = N; in main()
35 assert(s == N-3); in main()
38 s = N; in main()
42 assert(s == N-2); in main()
45 s = N; in main()
49 assert(s == N-1); in main()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.heap.operations/sort.heap/
Dsort_heap_comp.pass.cpp32 void test(unsigned N) in test() argument
34 int* ia = new int [N]; in test()
35 for (int i = 0; i < N; ++i) in test()
37 std::random_shuffle(ia, ia+N); in test()
38 std::make_heap(ia, ia+N, std::greater<int>()); in test()
39 std::sort_heap(ia, ia+N, std::greater<int>()); in test()
40 assert(std::is_sorted(ia, ia+N, std::greater<int>())); in test()
55 const int N = 1000; in main() local
56 std::unique_ptr<int>* ia = new std::unique_ptr<int> [N]; in main()
57 for (int i = 0; i < N; ++i) in main()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/containers/sequences/deque/deque.modifiers/
Dinsert_iter_iter.pass.cpp65 testN(int start, int N, int M) in testN() argument
72 if (0 <= i && i <= N) in testN()
74 C c1 = make(N, start); in testN()
81 if (0 <= i && i <= N) in testN()
83 C c1 = make(N, start); in testN()
88 for (int i = N/2-1; i <= N/2+1; ++i) in testN()
90 if (0 <= i && i <= N) in testN()
92 C c1 = make(N, start); in testN()
97 for (int i = N - M - 1; i <= N - M + 1; ++i) in testN()
99 if (0 <= i && i <= N) in testN()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.heap.operations/make.heap/
Dmake_heap_comp.pass.cpp32 void test(unsigned N) in test() argument
34 int* ia = new int [N]; in test()
35 for (int i = 0; i < N; ++i) in test()
37 std::random_shuffle(ia, ia+N); in test()
38 std::make_heap(ia, ia+N, std::greater<int>()); in test()
39 assert(std::is_heap(ia, ia+N, std::greater<int>())); in test()
54 const int N = 1000; in main() local
55 std::unique_ptr<int>* ia = new std::unique_ptr<int> [N]; in main()
56 for (int i = 0; i < N; ++i) in main()
58 std::random_shuffle(ia, ia+N); in main()
[all …]
/ndk/sources/cxx-stl/llvm-libc++/test/utilities/template.bitset/bitset.operators/
Dop_or.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 std::bitset<N> v1 = make_bitset<N>(); in test_op_or()
32 std::bitset<N> v2 = make_bitset<N>(); in test_op_or()
33 std::bitset<N> v3 = v1; in test_op_or()
Dop_and.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 std::bitset<N> v1 = make_bitset<N>(); in test_op_and()
32 std::bitset<N> v2 = make_bitset<N>(); in test_op_and()
33 std::bitset<N> v3 = v1; in test_op_and()
Dop_not.pass.cpp18 template <std::size_t N>
19 std::bitset<N>
22 std::bitset<N> v; in make_bitset()
23 for (std::size_t i = 0; i < N; ++i) in make_bitset()
28 template <std::size_t N>
31 std::bitset<N> v1 = make_bitset<N>(); in test_op_not()
32 std::bitset<N> v2 = make_bitset<N>(); in test_op_not()
33 std::bitset<N> v3 = v1; in test_op_not()

12345678910>>...17