1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Function template float_sort</title> 5<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../index.html" title="Boost.Sort"> 8<link rel="up" href="../../../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_hpp" title="Header <boost/sort/spreadsort/float_sort.hpp>"> 9<link rel="prev" href="float_mem_cast.html" title="Function template float_mem_cast"> 10<link rel="next" href="float_so_idm45878551916480.html" title="Function template float_sort"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="float_mem_cast.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="float_so_idm45878551916480.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="refentry"> 26<a name="boost.sort.spreadsort.float_so_idm45878545215024"></a><div class="titlepage"></div> 27<div class="refnamediv"> 28<h2><span class="refentrytitle">Function template float_sort</span></h2> 29<p>boost::sort::spreadsort::float_sort</p> 30</div> 31<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 32<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_hpp" title="Header <boost/sort/spreadsort/float_sort.hpp>">boost/sort/spreadsort/float_sort.hpp</a>> 33 34</span> 35<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> RandomAccessIter<span class="special">></span> 36 <span class="keyword">void</span> <span class="identifier">float_sort</span><span class="special">(</span><span class="identifier">RandomAccessIter</span> first<span class="special">,</span> <span class="identifier">RandomAccessIter</span> last<span class="special">)</span><span class="special">;</span></pre></div> 37<div class="refsect1"> 38<a name="idm45477845686672"></a><h2>Description</h2> 39<p>\brief @c float_sort with casting to the appropriate size. 40 41\param[in] first Iterator pointer to first element. 42\param[in] last Iterator pointing to one beyond the end of data. 43</p> 44<p>Some performance plots of runtime vs. n and log(range) are provided:<br> 45 <a href="../../../../../doc/graph/windows_float_sort.htm" target="_top">windows_float_sort</a> <br> 46 <a href="../../../../../doc/graph/osx_float_sort.htm" target="_top">osx_float_sort</a></p> 47<p><b>A simple example of sorting some floating-point is: </b></p> 48<pre class="programlisting"><span class="identifier">vector</span><span class="special"><</span><span class="keyword">float</span><span class="special">></span> <span class="identifier">vec</span><span class="special">;</span> 49<span class="identifier">vec</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">1</span><span class="special">.</span><span class="number">0</span><span class="special">)</span><span class="special">;</span> 50<span class="identifier">vec</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">2</span><span class="special">.</span><span class="number">3</span><span class="special">)</span><span class="special">;</span> 51<span class="identifier">vec</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">1</span><span class="special">.</span><span class="number">3</span><span class="special">)</span><span class="special">;</span> 52<span class="identifier">spreadsort</span><span class="special">(</span><span class="identifier">vec</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <span class="identifier">vec</span><span class="special">.</span><span class="identifier">end</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span> 53</pre> 54<p> </p> 55<p> 56</p> 57<p><b>The sorted vector contains ascending values "1.0 1.3 2.3". </b></p> 58<p> 59</p> 60</div> 61</div> 62<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 63<td align="left"></td> 64<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Steven 65 Ross, Francisco Tapia, Orson Peters<p> 66 Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost 67 Software License, Version 1.0</a>. 68 </p> 69</div></td> 70</tr></table> 71<hr> 72<div class="spirit-nav"> 73<a accesskey="p" href="float_mem_cast.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../boost_sort_c___reference.html#header.boost.sort.spreadsort.float_sort_hpp"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="float_so_idm45878551916480.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 74</div> 75</body> 76</html> 77