Dune Core Modules (2.5.0)

lcm.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_LCM_HH
4#define DUNE_LCM_HH
5
10#include <dune/common/gcd.hh>
11
12namespace Dune
13{
14
28 template<long m, long n>
29 struct Lcm
30 {
31 static void conceptCheck()
32 {
33 static_assert(0<m, "m must be positive!");
34 static_assert(0<n, "n must be positive!");
35 }
40 const static long value = (m/Gcd<m,n>::value)*n;
41 };
42}
43
44#endif
Statically compute the greatest common divisor of two integers.
static const long value
The least common multiple of the template parameters m and n.
Definition: lcm.hh:40
Dune namespace.
Definition: alignment.hh:11
Calculator of the greatest common divisor.
Definition: gcd.hh:66
Calculate the least common multiple of two numbers.
Definition: lcm.hh:30
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)