1 #ifndef _SURFACEINSPECTOR_MATHS_SCALAR_HPP_
2 #define _SURFACEINSPECTOR_MATHS_SCALAR_HPP_
4 #include <surfaceinspector/util/Object.hpp>
8 namespace SurfaceInspector {
namespace maths {
32 static T
binom(T
const n, T
const k);
55 {
return binom(n+k-1, k);}
101 static T
inline pow2(T
const k)
102 {
return ((T)1) << k;}
106 #include <surfaceinspector/maths/Scalar.tpp>
Class providing common operations to work with scalars.
Definition: Scalar.hpp:18
static T binom(T const n, T const k)
Compute Newton binomial .
static T combinationsNoRepetition(T const n, T const k)
Compute combinations (order does not matter) of $fn @_fakenlk.
Definition: Scalar.hpp:44
static T factorial(T const n)
Compute the factorial of ( )
static T combinationsRepetition(T const n, T const k)
Compute combinations (order does not matter) of elements considering allowing repetitions.
Definition: Scalar.hpp:54
static T variationsNoRepetition(T const n, T const k)
Compute variations (order does matter) of elements considering with no repetitions.
static T pow2(T const k)
Compute the base power in a fast way. Notice this method only works with exponents and integer num...
Definition: Scalar.hpp:101
static T variationsRepetition(T const n, T const k)
Compute variations (order does matter) of elements considering with repetitions.
Class representing an object. All surface inspector classes must extend Object.
Definition: Object.hpp:12