planc
Parallel Lowrank Approximation with Non-negativity Constraints
ntfmu.hpp
Go to the documentation of this file.
1 /* Copyright Ramakrishnan Kannan 2018 */
2 
3 #ifndef NTF_NTFMU_HPP_
4 #define NTF_NTFMU_HPP_
5 
6 #include "ntf/auntf.hpp"
7 
8 namespace planc {
9 class NTFMU : public AUNTF {
10  protected:
11  MAT update(const int mode) {
12  MAT H(this->m_ncp_factors.factor(mode));
13  MAT temp = H * this->gram_without_one + EPSILON;
14  H = (H % this->ncp_mttkrp_t[mode].t()) / temp;
15  return H.t();
16  }
17 
18  public:
19  NTFMU(const Tensor &i_tensor, const int i_k, algotype i_algo)
20  : AUNTF(i_tensor, i_k, i_algo) {}
21 }; // class NTFMU
22 } // namespace planc
23 
24 #endif // NTF_NTFMU_HPP_
Data is stored such that the unfolding is column major.
Definition: tensor.hpp:32
algotype
Definition: utils.h:10
#define EPSILON
Definition: utils.h:44
#define MAT
Definition: utils.h:52
ncp_factors contains the factors of the ncp every ith factor is of size n_i * k number of factors is ...
Definition: ncpfactors.hpp:20
NTFMU(const Tensor &i_tensor, const int i_k, algotype i_algo)
Definition: ntfmu.hpp:19