void generate_matrix_123(rokko::distributed_matrix<T>& mat) { for(int local_i=0; local_i<mat.m_local; ++local_i) { for(int local_j=0; local_j<mat.n_local; ++local_j) { int global_i = mat.translate_l2g_row(local_i); int global_j = mat.translate_l2g_col(local_j); mat.set_local(local_i, local_j, mat.m_global * global_j + global_i ); } } }
void function_matrix(rokko::localized_vector<double> const& eigval_tmp, rokko::distributed_matrix<T, MATRIX_MAJOR> const& eigvec, rokko::distributed_matrix<T, MATRIX_MAJOR>& result, rokko::distributed_matrix<T, MATRIX_MAJOR>& tmp) { for (int local_j=0; local_j<eigvec.get_n_local(); ++local_j) { int global_j = eigvec.translate_l2g_col(local_j); double coeff = eigval_tmp(global_j); for (int local_i=0; local_i<eigvec.get_m_local(); ++local_i) { double value = eigvec.get_local(local_i, local_j); tmp.set_local(local_i, local_j, coeff * value); } } product(1, tmp, false, eigvec, true, 0, result); }