18#ifndef OPERATOR_TIMES_HPP
19#define OPERATOR_TIMES_HPP
21template<sp_d T> op_add<T>
operator+(
const shared_ptr<MetaMat<T>>&
A,
const shared_ptr<MetaMat<T>>& B) {
return op_add<T>(
A, B); }
23template<sp_d T> op_scale<T>
operator*(
const T value,
const shared_ptr<MetaMat<T>>&
M) {
return op_scale<T>(value,
M); }
25template<sp_d T> op_scale<T>
operator*(
const T value, op_add<T>&&
M) {
return op_scale<T>(value, std::forward<op_add<T>>(
M)); }
27template<sp_d T>
const shared_ptr<MetaMat<T>>&
operator+=(
const shared_ptr<MetaMat<T>>&
M,
const op_scale<T>&
A) {
32template<sp_d T>
const unique_ptr<MetaMat<T>>&
operator+=(
const unique_ptr<MetaMat<T>>&
M,
const op_scale<T>&
A) {
37template<sp_d T> unique_ptr<MetaMat<T>>
operator*(
const T value, unique_ptr<MetaMat<T>>&&
M) {
38 if(
nullptr ==
M)
return nullptr;
41 return std::forward<unique_ptr<MetaMat<T>>>(
M);
52template<sp_d T> Mat<T>
operator*(
const shared_ptr<MetaMat<T>>&
M,
const Mat<T>&
A) {
return M->operator*(
A); }
54template<sp_d T> Mat<T>
operator*(
const unique_ptr<MetaMat<T>>&
M,
const Mat<T>&
A) {
return M->operator*(
A); }
56template<sp_d T>
const shared_ptr<MetaMat<T>>&
operator*=(
const shared_ptr<MetaMat<T>>&
M,
const T value) {
67template<sp_d T> unique_ptr<MetaMat<T>>
operator+(
const shared_ptr<MetaMat<T>>&
A, unique_ptr<MetaMat<T>>&& B) {
69 return std::forward<unique_ptr<MetaMat<T>>>(B);
72template<sp_d T> unique_ptr<MetaMat<T>>
operator+(unique_ptr<MetaMat<T>>&&
A, unique_ptr<MetaMat<T>>&& B) {
73 A->operator+=(std::forward<unique_ptr<MetaMat<T>>>(B));
74 return std::forward<unique_ptr<MetaMat<T>>>(
A);
77template<sp_d T>
const shared_ptr<MetaMat<T>>&
operator+=(
const shared_ptr<MetaMat<T>>&
M,
const shared_ptr<MetaMat<T>>&
A) {
82template<sp_d T>
const shared_ptr<MetaMat<T>>&
operator+=(
const shared_ptr<MetaMat<T>>&
M, unique_ptr<MetaMat<T>>&&
A) {
83 M->operator+=(std::forward<unique_ptr<MetaMat<T>>>(
A));
87template<sp_d T>
const unique_ptr<MetaMat<T>>&
operator+=(
const unique_ptr<MetaMat<T>>&
M,
const shared_ptr<MetaMat<T>>&
A) {
92template<sp_d DT, sp_i IT>
const unique_ptr<MetaMat<DT>>&
operator+=(
const unique_ptr<MetaMat<DT>>&
M,
const triplet_form<DT, IT>&
A) {
op_scale< T > operator*(const T value, const shared_ptr< MetaMat< T > > &M)
Definition operator_times.hpp:23
const shared_ptr< MetaMat< T > > & operator*=(const shared_ptr< MetaMat< T > > &M, const T value)
Definition operator_times.hpp:56
const shared_ptr< MetaMat< T > > & operator+=(const shared_ptr< MetaMat< T > > &M, const op_scale< T > &A)
Definition operator_times.hpp:27
op_add< T > operator+(const shared_ptr< MetaMat< T > > &A, const shared_ptr< MetaMat< T > > &B)
Definition operator_times.hpp:21