Dense tensor generators. More...
#include "inc/dense/dense.h"
Namespaces | |
namespace | syten |
Syten namespace. | |
Functions | |
template<typename Scalar > | |
void | syten::makeDiagonal (DenseTensor< 2, Scalar > &a, DenseTensor< 1, Scalar > const &d) |
Makes a diagonal with elements from d More... | |
template<typename Scalar > | |
void | syten::makeIdentity (DenseTensor< 2, Scalar > &a) |
Makes a square rank-2 tensor the identity matrix, \( A_{ij} = 1 \mathrm{\; if \;} i \equiv j \mathrm{\; else\; } 0 \). More... | |
template<typename Scalar > | |
void | syten::makeIdentity (DenseTensor< 3, Scalar > &a, Index offset=0) |
Makes a rank-3 tensor a shifted identity tensor, \( A_{ijk} = 1 \mathrm{\; if\;} (i * \mathrm{dim}(2) + j + \mathrm{\; offset \;}) \equiv k \mathrm{\; else \;} 0 \). More... | |
template<typename Scalar > | |
void | syten::makeIdentity (DenseTensor< 4, Scalar > &a) |
Makes a rank-4 tensor a doubled identity tensor, \( A_{ijkl} = 1 \mathrm{\; if\; } i \equiv j \wedge k \equiv l \mathrm{\; else\; } 0 \). More... | |
template<Rank rank, typename Scalar > | |
void | syten::makeRandom (DenseTensor< rank, Scalar > &a, double b=-2., double e=2.) |
Fills the tensor with random values between b and e. More... | |
template<Rank rank, typename BaseScalar > | |
void | syten::makeRandom (DenseTensor< rank, std::complex< BaseScalar > > &a, double b=-2., double e=2.) |
Fills the tensor with random values between b+bi and e+ei. More... | |
template<Rank rank, typename Scalar > | |
void | syten::makeZero (DenseTensor< rank, Scalar > &a) |
Sets all elements to zero. More... | |
Dense tensor generators.