36 template<
typename MajorT>
 
   39   for (std::size_t i = 0; i < A.
size1(); i++)
 
   40     for (std::size_t j = 0; j < A.
size2(); ++j)
 
   50   std::cout << std::endl;
 
   51   std::cout << 
"------- Tutorial NMF --------" << std::endl;
 
   52   std::cout << std::endl;
 
   72   std::cout << 
"Input matrices:" << std::endl;
 
   73   std::cout << 
"V" << V << std::endl;
 
   74   std::cout << 
"W" << W << std::endl;
 
   75   std::cout << 
"H" << H << 
"\n" << std::endl;
 
   87   std::cout << 
"Computing NMF" << std::endl;
 
   90   std::cout << 
"RESULT:" << std::endl;
 
   91   std::cout << 
"V" << V << std::endl;
 
   92   std::cout << 
"W" << W << std::endl;
 
   93   std::cout << 
"H" << H << 
"\n" << std::endl;
 
   98   std::cout << 
"W*H:" << std::endl;
 
  100   std::cout << resultCorrect << std::endl;
 
  102   std::cout << std::endl;
 
  103   std::cout << 
"------- Tutorial completed --------" << std::endl;
 
  104   std::cout << std::endl;
 
Implementation of the dense matrix class. 
Configuration class for the nonnegative-matrix-factorization algorithm. Specify tolerances, maximum iteration counts, etc., here. 
VectorT prod(std::vector< std::vector< T, A1 >, A2 > const &matrix, VectorT const &vector)
vcl_size_t max_iterations() const 
Returns the maximum number of iterations for the NMF algorithm. 
size_type size2() const
Returns the number of columns. 
size_type size1() const
Returns the number of rows. 
void nmf(viennacl::matrix_base< ScalarType > const &V, viennacl::matrix_base< ScalarType > &W, viennacl::matrix_base< ScalarType > &H, viennacl::linalg::nmf_config const &conf)
The nonnegative matrix factorization (approximation) algorithm as suggested by Lee and Seung...
void fill_random(viennacl::matrix_base< ScalarType > &v)
bool print_relative_error() const 
Returns the flag specifying whether the relative tolerance should be printed in each iteration...
Provides a nonnegative matrix factorization implementation. Experimental.