Template Function Jet::Utilities::DiagMatrix

Function Documentation

template<typename Tensor, typename T>
inline Tensor Jet::Utilities::DiagMatrix(const std::vector<T> &vec)

Returns a diagonal tensor with the given main diagonal.

Template Parameters
  • Tensor – Type of the tensor.

  • T – Type of the diagonal entries.

Parameters

vec – Entries to be copied to the main diagonal of the tensor.

Returns

Tensor with the given main diagonal.