diff options
author | Paolo Carlini <pcarlini@suse.de> | 2008-01-10 02:07:41 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2008-01-10 02:07:41 +0000 |
commit | 5817ff8e5f722e2a36ed6982f94d003164c01992 (patch) | |
tree | 5060e35f2e0473b6627ef590ec71e1576524772b /libstdc++-v3/include/parallel/find.h | |
parent | 299f57348c2199656476e39b43643d04bdad1985 (diff) | |
download | gcc-5817ff8e5f722e2a36ed6982f94d003164c01992.zip gcc-5817ff8e5f722e2a36ed6982f94d003164c01992.tar.gz gcc-5817ff8e5f722e2a36ed6982f94d003164c01992.tar.bz2 |
multiway_merge.h: Reformat to 80 columns; adjust some inline specifiers; other minor style fixes.
2008-01-09 Paolo Carlini <pcarlini@suse.de>
* include/parallel/multiway_merge.h: Reformat to 80 columns;
adjust some inline specifiers; other minor style fixes.
* include/parallel/losertree.h: Likewise.
* include/parallel/list_partition.h: Likewise.
* include/parallel/multiseq_selection.h: Likewise.
* include/parallel/workstealing.h: Likewise.
* include/parallel/base.h: Likewise.
* include/parallel/par_loop.h: Likewise.
* include/parallel/numeric: Likewise.
* include/parallel/quicksort.h: Likewise.
* include/parallel/algorithmfwd.h: Likewise.
* include/parallel/for_each_selectors.h: Likewise.
* include/parallel/omp_loop_static.h: Likewise.
* include/parallel/random_shuffle.h: Likewise.
* include/parallel/balanced_quicksort.h: Likewise.
* include/parallel/set_operations.h: Likewise.
* include/parallel/tree.h: Likewise.
* include/parallel/merge.h: Likewise.
* include/parallel/unique_copy.h: Likewise.
* include/parallel/settings.h: Likewise.
* include/parallel/multiway_mergesort.h: Likewise.
* include/parallel/numericfwd.h: Likewise.
* include/parallel/search.h: Likewise.
* include/parallel/partition.h: Likewise.
* include/parallel/compatibility.h: Likewise.
* include/parallel/partial_sum.h: Likewise.
* include/parallel/find.h: Likewise.
* include/parallel/algo.h: Likewise.
* include/parallel/queue.h: Likewise.
* include/parallel/omp_loop.h: Likewise.
* include/parallel/sort.h: Likewise.
* include/parallel/random_number.h: Likewise.
From-SVN: r131440
Diffstat (limited to 'libstdc++-v3/include/parallel/find.h')
-rw-r--r-- | libstdc++-v3/include/parallel/find.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/libstdc++-v3/include/parallel/find.h b/libstdc++-v3/include/parallel/find.h index 3a0db1f..051c69e 100644 --- a/libstdc++-v3/include/parallel/find.h +++ b/libstdc++-v3/include/parallel/find.h @@ -62,7 +62,7 @@ template<typename RandomAccessIterator1, typename RandomAccessIterator2, typename Pred, typename Selector> - std::pair<RandomAccessIterator1, RandomAccessIterator2> + inline std::pair<RandomAccessIterator1, RandomAccessIterator2> find_template(RandomAccessIterator1 begin1, RandomAccessIterator1 end1, RandomAccessIterator2 begin2, Pred pred, Selector selector) { @@ -70,13 +70,13 @@ template<typename RandomAccessIterator1, { case Settings::GROWING_BLOCKS: return find_template(begin1, end1, begin2, pred, selector, - growing_blocks_tag()); + growing_blocks_tag()); case Settings::CONSTANT_SIZE_BLOCKS: return find_template(begin1, end1, begin2, pred, selector, - constant_size_blocks_tag()); + constant_size_blocks_tag()); case Settings::EQUAL_SPLIT: return find_template(begin1, end1, begin2, pred, selector, - equal_split_tag()); + equal_split_tag()); default: _GLIBCXX_PARALLEL_ASSERT(false); return std::make_pair(begin1, begin2); @@ -158,8 +158,9 @@ template<typename RandomAccessIterator1, omp_destroy_lock(&result_lock); delete[] borders; - return std::pair<RandomAccessIterator1, RandomAccessIterator2>( - begin1 + result, begin2 + result); + return + std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result, + begin2 + result); } #endif @@ -205,8 +206,8 @@ template<typename RandomAccessIterator1, difference_type length = end1 - begin1; - difference_type sequential_search_size = std::min<difference_type>( - length, Settings::find_sequential_search_size); + difference_type sequential_search_size = + std::min<difference_type>(length, Settings::find_sequential_search_size); // Try it sequentially first. std::pair<RandomAccessIterator1, RandomAccessIterator2> find_seq_result = @@ -267,23 +268,25 @@ template<typename RandomAccessIterator1, omp_unset_lock(&result_lock); } - block_size = std::min<difference_type>( - block_size * Settings::find_increasing_factor, - Settings::find_maximum_block_size); + block_size = + std::min<difference_type>(block_size + * Settings::find_increasing_factor, + Settings::find_maximum_block_size); // Get new block, update pointer to next block. start = - fetch_and_add<difference_type>(&next_block_start, block_size); - stop = (length < (start + block_size)) ? - length : (start + block_size); + fetch_and_add<difference_type>(&next_block_start, block_size); + stop = ((length < (start + block_size)) + ? length : (start + block_size)); } } //parallel omp_destroy_lock(&result_lock); // Return iterator on found element. - return std::pair<RandomAccessIterator1, RandomAccessIterator2>( - begin1 + result, begin2 + result); + return + std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result, + begin2 + result); } #endif @@ -391,8 +394,9 @@ template<typename RandomAccessIterator1, omp_destroy_lock(&result_lock); // Return iterator on found element. - return std::pair<RandomAccessIterator1, RandomAccessIterator2>( - begin1 + result, begin2 + result); + return + std::pair<RandomAccessIterator1, RandomAccessIterator2>(begin1 + result, + begin2 + result); } #endif } // end namespace |