24#include <boost/format.hpp>
33template <
typename OutputType,
typename InputType>
47template <
typename T1,
typename T2 = T1>
49 public Function<product_t<typename T1::OutputType, typename T2::OutputType>, typename T1::InputType> {
51 static_assert(std::is_same<typename T1::InputType, typename T2::InputType>::value,
"FunctionProduct: T1 and T2 should have the same InputType.");
98 throw std::invalid_argument(
"FunctionProduct(const int): Can't convert a non-zero integer to a 'zero' instance.");
111 return (boost::format(
"((%s) * (%s))") % this->m_lhs.description() % this->m_rhs.description()).str();
122 const T1&
lhs()
const {
return this->m_lhs; }
127 const T2&
rhs()
const {
return this->m_rhs; }
137 return this->m_lhs(in) * this->m_rhs(in);
152template <
typename _OutputType,
typename _InputType>
207template <
typename F1,
typename F2,
typename = IsFunction<F1>,
typename = IsFunction<F2>>
Definition: Function.hpp:153
virtual ~Function()=default
_OutputType OutputType
Definition: Function.hpp:156
virtual OutputType operator()(const InputType &in) const =0
_InputType InputType
Definition: Function.hpp:159
Definition: Function.hpp:49
typename T1::InputType InputType
Definition: Function.hpp:66
const T2 & rhs() const
Definition: Function.hpp:127
FunctionProduct()=default
FunctionProduct(const T1 &lhs, const T2 &rhs)
Definition: Function.hpp:78
FunctionProduct(const int zero)
Definition: Function.hpp:94
const T1 & lhs() const
Definition: Function.hpp:122
OutputType operator()(const InputType &in) const override
Definition: Function.hpp:136
product_t< typename T1::OutputType, typename T2::OutputType > OutputType
Definition: Function.hpp:63
std::string description() const
Definition: Function.hpp:110
Definition: BaseOneElectronIntegralBuffer.hpp:25
typename std::enable_if< B, T >::type enable_if_t
Definition: type_traits.hpp:37
decltype(std::declval< T >() *std::declval< U >()) product_t
Definition: aliases.hpp:35
enable_if_t< std::is_base_of< Function< typename T::OutputType, typename T::InputType >, T >::value > IsFunction
Definition: Function.hpp:196
FunctionProduct< F1, F2 > operator*(const F1 &lhs, const F2 &rhs)
Definition: Function.hpp:208