monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
vector_minus.cpp
Go to the documentation of this file.
1 #include "../../../include/monolish_blas.hpp"
2 #include "../../internal/monolish_internal.hpp"
3 
4 namespace monolish {
6 // vec - scalar
8 template <typename T> vector<T> vector<T>::operator-() {
9 
10  Logger &logger = Logger::get_instance();
11  logger.func_in(monolish_func);
12 
13  vector<T> ans(val.size());
14  if (gpu_status == true) {
15  ans.send();
16  }
17 
18  internal::vmul(val.size(), val.data(), -1, ans.data(), gpu_status);
19  logger.func_out();
20  return ans;
21 }
22 
25 
26 } // 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::func_out
void func_out()
Definition: logger_utils.cpp:80
monolish::vector::operator-
vector< Float > operator-()
Sign inversion.
Definition: vector_minus.cpp:8
monolish::vector::data
const Float * data() const
returns a direct pointer to the vector
Definition: monolish_vector.hpp:230
monolish
Definition: monolish_matrix_blas.hpp:9
monolish::vector
vector class
Definition: monolish_coo.hpp:25
monolish::vector::send
void send() const
send data to GPU
Definition: gpu_comm.cpp:8
monolish::Logger::get_instance
static Logger & get_instance()
Definition: monolish_logger.hpp:42
monolish::Logger::func_in
void func_in(const std::string func_name)
Definition: logger_utils.cpp:69