Dune Core Modules (2.6.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 
12 namespace 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: alignedallocator.hh:10
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.80.0 (Apr 19, 22:31, 2024)