Dune Core Modules (2.3.1)

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
11#include <dune/common/gcd.hh>
12
13namespace Dune
14{
15
29 template<long m, long n>
30 struct Lcm
31 {
32 static void conceptCheck()
33 {
34 dune_static_assert(0<m, "m must be positive!");
35 dune_static_assert(0<n, "n must be positive!");
36 }
41 const static long value = (m/Gcd<m,n>::value)*n;
42 };
43}
44
45#endif
Statically compute the greatest common divisor of two integers.
#define dune_static_assert(COND, MSG)
Helper template so that compilation fails if condition is not true.
Definition: static_assert.hh:79
static const long value
The least common multiple of the template parameters m and n.
Definition: lcm.hh:41
Dune namespace.
Definition: alignment.hh:14
Fallback implementation of the C++0x static_assert feature.
Calculator of the greatest common divisor.
Definition: gcd.hh:67
Calculate the least common multiple of two numbers.
Definition: lcm.hh:31
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)