monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
fill_coo.cpp
Go to the documentation of this file.
1 #include "../../../include/common/monolish_dense.hpp"
2 #include "../../../include/common/monolish_logger.hpp"
3 #include "../../../include/common/monolish_matrix.hpp"
4 #include "../../internal/monolish_internal.hpp"
5 
6 namespace monolish {
7 namespace matrix {
8 
9 template <typename T> void COO<T>::fill(T value) {
10  Logger &logger = Logger::get_instance();
11  logger.util_in(monolish_func);
12 #pragma omp parallel for
13  for (size_t i = 0; i < get_nnz(); i++) {
14  val[i] = value;
15  }
16  logger.util_out();
17 }
18 template void COO<double>::fill(double value);
19 template void COO<float>::fill(float value);
20 
21 } // namespace matrix
22 } // namespace monolish
monolish_func
#define monolish_func
Definition: monolish_logger.hpp:9
monolish::Logger
logger class (singleton, for developper class)
Definition: monolish_logger.hpp:19
monolish::Logger::util_out
void util_out()
Definition: logger_utils.cpp:123
monolish::Logger::util_in
void util_in(const std::string func_name)
Definition: logger_utils.cpp:113
monolish::matrix::COO::fill
void fill(Float value)
fill matrix elements with a scalar value
Definition: fill_coo.cpp:9
monolish
Definition: monolish_matrix_blas.hpp:9
monolish::Logger::get_instance
static Logger & get_instance()
Definition: monolish_logger.hpp:42