Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F5298413
math.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
816 B
Referenced Files
None
Subscribers
None
math.hpp
View Options
//===-- rosa/support/math.hpp -----------------------------------*- C++ -*-===//
//
// The RoSA Framework
//
//===----------------------------------------------------------------------===//
///
/// \file rosa/support/math.hpp
///
/// \author David Juhasz (david.juhasz@tuwien.ac.at)
///
/// \date 2017
///
/// \brief Math helpers.
///
//===----------------------------------------------------------------------===//
#ifndef ROSA_SUPPORT_MATH_HPP
#define ROSA_SUPPORT_MATH_HPP
#include
<cstdlib>
namespace
rosa
{
/// Computes log base 2 of a number.
///
/// \param N the number to compute log base 2 for
///
/// \return log base 2 of \p N
constexpr
size_t
log2
(
const
size_t
N
)
{
return
((
N
<
2
)
?
1
:
1
+
log2
(
N
/
2
));
}
}
// End namespace rosa
#endif
// ROSA_SUPPORT_MATH_HPP
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sun, Apr 12, 11:35 AM (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
306365
Default Alt Text
math.hpp (816 B)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment