Array::packSquareMatrix(), Array::unpackSquareMatrix()

This commit is contained in:
Pavel Kirienko
2014-04-07 20:26:51 +04:00
parent 0c4e76a557
commit 159b14e129
3 changed files with 419 additions and 0 deletions
@@ -118,4 +118,17 @@ To try_implicit_cast(const From& from)
BooleanType<IsImplicitlyConvertibleFromTo<From, To>::Result>());
}
/**
* Some arithmetics
*/
template <unsigned Value> struct CompileTimeIntSqrt;
template <> struct CompileTimeIntSqrt<4> { enum { Result = 2 }; };
template <> struct CompileTimeIntSqrt<9> { enum { Result = 3 }; };
template <> struct CompileTimeIntSqrt<16> { enum { Result = 4 }; };
template <> struct CompileTimeIntSqrt<25> { enum { Result = 5 }; };
template <> struct CompileTimeIntSqrt<36> { enum { Result = 6 }; };
template <> struct CompileTimeIntSqrt<49> { enum { Result = 7 }; };
template <> struct CompileTimeIntSqrt<64> { enum { Result = 8 }; };
template <> struct CompileTimeIntSqrt<81> { enum { Result = 9 }; };
}