/usr/include/dune/common/lcm.hh is in libdune-common-dev 2.3.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_LCM_HH
#define DUNE_LCM_HH
/** \file
* \brief Statically compute the least common multiple of two integers
*/
#include <dune/common/static_assert.hh>
#include <dune/common/gcd.hh>
namespace Dune
{
/**
* @addtogroup Common
* @{
*/
/**
* @file
* This file provides template constructs for calculation the
* least common multiple.
*/
/**
* @brief Calculate the least common multiple of two numbers
*/
template<long m, long n>
struct Lcm
{
static void conceptCheck()
{
dune_static_assert(0<m, "m must be positive!");
dune_static_assert(0<n, "n must be positive!");
}
/**
* @brief The least common multiple of the template parameters
* m and n.
*/
const static long value = (m/Gcd<m,n>::value)*n;
};
}
#endif
|