3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>LCM Function Object</title>
5 <link rel="stylesheet" href="../math.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../index.html" title="Math Toolkit 2.1.0">
8 <link rel="up" href="../gcd_lcm.html" title="Chapter 11. Integer Utilities (Greatest Common Divisor and Least Common Multiple)">
9 <link rel="prev" href="gcd_function_object.html" title="GCD Function Object">
10 <link rel="next" href="run_time.html" title="Run-time GCD & LCM Determination">
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>
22 <div class="spirit-nav">
23 <a accesskey="p" href="gcd_function_object.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../gcd_lcm.html"><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="run_time.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="math_toolkit.lcm_function_object"></a><a class="link" href="lcm_function_object.html" title="LCM Function Object">LCM Function Object</a>
28 </h2></div></div></div>
30 <span class="bold"><strong>Header: </strong></span> <a href="../../../../../boost/math/common_factor_rt.hpp" target="_top"><boost/math/common_factor_rt.hpp></a>
32 <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">IntegerType</span> <span class="special">></span>
33 <span class="keyword">class</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">lcm_evaluator</span>
34 <span class="special">{</span>
35 <span class="keyword">public</span><span class="special">:</span>
36 <span class="comment">// Types</span>
37 <span class="keyword">typedef</span> <span class="identifier">IntegerType</span> <span class="identifier">result_type</span><span class="special">;</span>
38 <span class="keyword">typedef</span> <span class="identifier">IntegerType</span> <span class="identifier">first_argument_type</span><span class="special">;</span>
39 <span class="keyword">typedef</span> <span class="identifier">IntegerType</span> <span class="identifier">second_argument_type</span><span class="special">;</span>
41 <span class="comment">// Function object interface</span>
42 <span class="identifier">result_type</span> <span class="keyword">operator</span> <span class="special">()(</span> <span class="identifier">first_argument_type</span> <span class="keyword">const</span> <span class="special">&</span><span class="identifier">a</span><span class="special">,</span>
43 <span class="identifier">second_argument_type</span> <span class="keyword">const</span> <span class="special">&</span><span class="identifier">b</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
44 <span class="special">};</span>
47 The boost::math::lcm_evaluator class template defines a function object class
48 to return the least common multiple of two integers. The template is parameterized
49 by a single type, called IntegerType here. This type should be a numeric type
50 that represents integers. The result of the function object is always nonnegative,
51 even if either of the operator arguments is negative. If the least common multiple
52 is beyond the range of the integer type, the results are undefined.
55 This function object class template is used in the corresponding version of
56 the LCM function template. If a numeric type wants to customize evaluations
57 of its least common multiples, then the type should specialize on the lcm_evaluator
61 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
62 <td align="left"></td>
63 <td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal,
64 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
65 Holin, Bruno Lalande, John Maddock, Johan Råde, Gautam Sewani, Benjamin Sobotta,
66 Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p>
67 Distributed under the Boost Software License, Version 1.0. (See accompanying
68 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
73 <div class="spirit-nav">
74 <a accesskey="p" href="gcd_function_object.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../gcd_lcm.html"><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="run_time.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>