3 #ifndef NTF_NTFANLSBPP_HPP_ 4 #define NTF_NTFANLSBPP_HPP_ 11 #define ONE_THREAD_MATRIX_SIZE 2000 15 MAT update(
const int mode) {
16 MAT othermat(this->m_ncp_factors.factor(mode).t());
17 unsigned int numThreads =
19 #pragma omp parallel for schedule(dynamic) 20 for (
UINT i = 0; i < numThreads; i++) {
23 if (spanEnd > this->ncp_mttkrp_t[mode].n_cols - 1) {
24 spanEnd = this->ncp_mttkrp_t[mode].n_cols - 1;
28 if (spanStart <= spanEnd) {
29 if (spanStart == spanEnd) {
31 this->gram_without_one,
32 (
VEC)this->ncp_mttkrp_t[mode].col(spanStart),
true);
35 this->gram_without_one,
36 (
MAT)this->ncp_mttkrp_t[mode].cols(spanStart, spanEnd),
true);
39 INFO <<
"Scheduling " << worh <<
" start=" << spanStart
40 <<
", end=" << spanEnd <<
", tid=" << omp_get_thread_num()
47 INFO <<
"completed " << worh <<
" start=" << spanStart
48 <<
", end=" << spanEnd <<
", tid=" << omp_get_thread_num()
49 <<
" cpu=" << sched_getcpu() <<
" time taken=" << t2
50 <<
" num_iterations()=" << numIter << std::endl;
52 if (spanStart == spanEnd) {
54 othermat.col(i) = solVec;
56 othermat.cols(spanStart, spanEnd) =
68 :
AUNTF(i_tensor, i_k, i_algo) {}
73 #endif // NTF_NTFANLSBPP_HPP_ MATTYPE getSolutionMatrix()
Data is stored such that the unfolding is column major.
#define ONE_THREAD_MATRIX_SIZE
VECTYPE getSolutionVector()
NTFANLSBPP(const Tensor &i_tensor, const int i_k, algotype i_algo)
ncp_factors contains the factors of the ncp every ith factor is of size n_i * k number of factors is ...