cMHN 1.0
C++ library for learning MHNs with pRC
utility.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef cMHN_TT_UTILITY_H
4#define cMHN_TT_UTILITY_H
5
6#include <prc.hpp>
7
8namespace cMHN::TT
9{
10 template<pRC::Size D, pRC::Size N = 2>
11 constexpr auto getModeSizes()
12 {
13 return pRC::makeConstantSequence<pRC::Size, D, N>();
14 }
15
16 template<pRC::Size D, pRC::Size R, pRC::Size N = 2>
17 constexpr auto getRanks()
18 {
19 return typename decltype(round(pRC::TensorTrain::Tensor<pRC::Float<>,
20 decltype(getModeSizes<D, N>()),
21 decltype(pRC::makeConstantSequence<pRC::Size, D - 1, R>())>()))::
22 Ranks();
23 }
24}
25
26#endif // cMHN_TT_UTILITY_H
Definition: als.hpp:12
constexpr auto getRanks()
Definition: utility.hpp:17
constexpr auto getModeSizes()
Definition: utility.hpp:11