einsums::linear_algebra::direct_product#

Note

Generated from the C++ headers by apiary --emit-cpp-docs-json.

Defined in header Einsums/LinearAlgebra.hpp.

template<TensorConcept AType, TensorConcept BType, TensorConcept CType, typename T>
requires (SameRank<AType, BType, CType>)
void direct_product(T alpha, const AType &A, const BType &B, T beta, CType *C)#

Compute the direct product between two tensors and accumulate them into another. This is the element-wise (Hadamard) product of the two tensors.

\[c_i := \alpha a_i b_i + \beta c_i\]

Added in version 1.0.0.

Template Parameters:
  • AType – The type of the A tensor.

  • BType – The type of the B tensor.

  • CType – The type of the C tensor.

  • T – The type of the scale factors.

Parameters:
  • alpha – The scale factor for the product.

  • A,B – The tensors being multiplied.

  • beta – The scale factor for the output.

  • C – The output tensor.